博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
SSM整合配置
阅读量:6890 次
发布时间:2019-06-27

本文共 1477 字,大约阅读时间需要 4 分钟。

Maven porn.xml配置

Spring配置文件applicationContext.xml

1 约束

2 开启注解扫描

3 Spring与Mybatis整合

1 创建db.properties文件

jdbc.driver=com.mysql.jdbc.Driverjdbc.url=jdbc:mysql://localhost:3306/ssm?useUnicode=true&characterEncoding=utf8jdbc.username=rootjdbc.password=root

2 Spring接管mybatis的Session工厂

3 配置自动扫描所有 Mapper 接口和文件

4 配置Spring事务


web.xml配置Spring MVC核心控制器

1 约束

2 配置核心控制器

dispatcherServlet
org.springframework.web.servlet.DispatcherServlet
contextConfigLocation
classpath:springmvc.xml
1
dispatcherServlet
/

3 配置编码过滤器

characterEncodingFilter
org.springframework.web.filter.CharacterEncodingFilter
encoding
UTF-8
characterEncodingFilter
/*

Spring MVC配置文件springmvc.xml

1 约束

2 Spring与Spring MVC整合

contextConfigLocation
classpath:applicationContext.xml
org.springframework.web.context.ContextLoaderListener

3 配置核心控制器

转载于:https://www.cnblogs.com/ctrlcoder/p/10781689.html

你可能感兴趣的文章
Libevent 事件循环(1)
查看>>
eclipse中点不出来提示
查看>>
环境列表
查看>>
windows常用命令
查看>>
jqgrid 选中行触发编辑,切换下一行时验证和异步保存上一行数据
查看>>
Mac电脑 阿里云ECS(ContentOS) Apache+vsftpd+nodejs+mongodb建站过程总结
查看>>
编程珠玑:单词频率最高选取
查看>>
公钥、私钥、摘要、数字签名、证书
查看>>
ascii
查看>>
JavaScript from jQuery
查看>>
document.defaultView 和window
查看>>
JS配置文件动态加载CSS,js和定义请求路径
查看>>
kafka配置文件注解
查看>>
文件的拷贝
查看>>
使用MTL库求解矩阵特征值和特征向量
查看>>
UVa10006 Carmichael Numbers【素数判定+快速模幂】
查看>>
HDU1319 POJ1595 UVA406 UVALive5490 ZOJ1312 Prime Cuts【素数筛选+打表】
查看>>
【基础篇】DatePickerDialog日期控件的基本使用(二) ——分别获取年、月、日、时、分...
查看>>
理解 Android Build 系统
查看>>
hdu4632
查看>>