基于目前所学的,可能版本比较老
1.目前web.xml有三种配置
a) 字符过滤器
b) Spring
c) SpringMVC
1.1详细参数
a)字符过滤器
① 配置<filter>标签
② 使用CharacterEncodingFilter类
③ 使用encoding参数
④ "/*" 不拦截jsp
b) Spring
① <listener>监听器读取Spring配置文件
② 使用ContextLoaderLitener类
③ contextConfigLocation参数
④ 配置<context-param>定义sping配置文件的位置
c) SpringMVC
① 配置前端控制器DispatcherServlet
② 使用DispatcherServlet类
③ contextConfigLocation参数
④ <load-starto-up>启动配置
⑤ "/" 拦截所有
2.目前Spring总结起来有3类(9个)
a) 告诉Spring需要的文件位置(2个)
b) 完成接口扫描,实例化接口对象(3个)
c) 配置AOP(4个)
2.1详细参数
a) 告诉Spring需要的文件位置(2个)
① 使用<context>标签
注解扫描以及配置属性加载文件(使用注解配置)
b) 完成接口扫描,实例化接口对象(3个)
配置流程:DataSource-->SqlSessionBean-->MapperScannerConfigurer
① DataSource-->DriverManagerDataSource-->${"properties文件中的名称"}
② SqlSessionFactory-->SqlSessionFactoryBean-->
<properties>
1.dataSource
2.typeAiasesPackage-->基于mapper.xml配置使用简化
③ MapperScannerConfigurer-->MapperScannerConfigurer-->
<properties>
1.basePackage,告诉Spring接口位置
2.SqlSessionBeanName-->实例化接口需要使用哪个工厂-->使用value<--autowire="ByName"
c) 配置AOP(4个)
配置流程:事物管理器-->通知-->声明式事务-->AOP
① 事物管理器-->DataSourceTransActionManager
② 通知-->before,after,throws等(针对类的AOP)
③ 声明式事务--> <tx:advice transaction-manager="??">(针对方法的AOP)
④ AOP-->选择cglib动态代理-->
<aop:pointcut>
expression="execution(* com.sshqx.service.impl.*.*(..))"
3.SpringMVC四个
a) 注解扫描
b) 注解声明,自动配置HanlerMappering和HandlerAdapter
c) 静态资源
d) 视图解析器
a) 注解扫描-->扫描controller中的接口
b) 注解声明<mvc:annotation-drivern>-->帮助我们配置.....
c) 静态资源的解析<mvc:resources>
d) 视图解析器-->InternalResourceViewResvoler