【六祎- Java】Spring整合Mybatis-配置文件web.xml
<!--1. SpringIOC容器配置加载 (listener)-->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<!--classpath 表示加载【当前项目】类路径下的配置文件-->
<!--classpath* 表示加载【所有项目】类路径下的配置文件; 这里的所有项目就是指项目的所有jar包的类路径下。 -->
<param-value>classpath*:spring/applicationContext-*.xml</param-value>
</context-param>
<!--2. 编码过滤器 (filter)-->
<filter>
<filter-name>characterEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>characterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!--3. 配置SpringMVC前端控制器 (servlet)-->
<servlet>
<servlet-name>dispatcherServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring/springmvc.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcherServlet</servlet-name>
<!--拦截路径: / 表示拦截所有路径,不包含jsp请求。要注意:一定要放行静态资源的访问-->
<!--拦截路径: *.do 表示拦截所有.do作为后缀的请求. 要注意:不支持restful请求-->
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
相关推荐
JudeJoo 2020-08-21
meleto 2020-08-15
lantingyue 2020-07-30
zyjj 2020-07-27
pengpengflyjhp 2020-07-19
htofly 2020-07-09
三动 2020-06-21
hyxinyu 2020-06-08
洗尽铅华 2020-06-07
shayuchaor 2020-06-07
xiamubawei 2020-06-04
方志朋 2020-05-30
一片荷叶 2020-05-27
spring艳 2020-05-16
zhangdy0 2020-05-06
80304053 2020-05-04
neweastsun 2020-05-04
shuiluobu 2020-05-01
itjavashuai 2020-04-26