Spring常用的web.xml文件配置
2014-01-04 23:13
309 查看
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>Dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet </servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/classes/applicationContext.xml</param-value>
</init-param>
</servlet>
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>com.cb.filter.Filter1</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<servlet-mapping>
<servlet-name>Dispatcher</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>Dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet </servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/classes/applicationContext.xml</param-value>
</init-param>
</servlet>
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>com.cb.filter.Filter1</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<servlet-mapping>
<servlet-name>Dispatcher</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
相关文章推荐
- 在Web.xml中自动扫描Spring的配置文件及resource时classpath*:与classpath:的区别
- 基于注解的Spring MVC(所需jar包,web.xml配置,Spring文件配置,@Controller,@RequestMapping,@RequestParam,model填参,EL取值)
- Spring中加载xml配置文件的常用的几种方式
- web.xml文件中配置(servlet, spring, filter, listenr)的加载顺序(一)
- SSH项目web.xml文件的常用配置【struts2的过滤器、spring监听器、解决Hibernate延迟加载问题的过滤器、解决中文乱码的过滤器】
- 第2.1.5章 WEB系统最佳实践Spring文件配置之spring-mvc.xml
- 在Web.xml中自动扫描Spring的配置文件及resource时classpath*:与classpath:的区别
- spring与servlet3.0无web.xml文件时的配置方式
- web.xml中配置spring配置(application.xml)文件
- Spring中,applicationContext.xml 配置文件在web.xml中的配置详解
- web.xml 文件中一般包括 servlet, spring, filter, listenr的配置。那么他们是按照一个什么顺序加载呢?
- web.xml 记载spring 配置文件的写法
- Spring中,applicationContext.xml 配置文件在web.xml中的配置详解
- SSM(spring-springmvc-mybatis)整合开发xml配置文件内容springmvc-config.xml,application.xml,web.xml
- 在Web.xml中自动扫描Spring的配置文件及resource时classpath*:与classpath:的区别
- 通过web.xml文件自动启动spring容器加载对应的配置文件
- Spring和Struts2配置文件不在默认路径下的web.xml配置方法
- Spring中,applicationContext.xml 配置文件在web.xml中的配置详解
- web.xml文件中配置(servlet, spring, filter, listenr)的加载顺序 研究
- 在web.xml中配置spring配置文件的路径