常用的web.xml文件配置
2018-03-10 23:13
274 查看
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"> <display-name>e3-manager-web</display-name> <!-- 解决post乱码 --> <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> <!-- springmvc的前端控制器 --> <servlet> <servlet-name>e3-manager</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <!-- contextConfigLocation不是必须的, 如果不配置contextConfigLocation, springmvc的配置文件默认在:WEB-INF/servlet的name+"-servlet.xml" --> <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>e3-manager</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> <!-- 加载spring容器 --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:spring/applicationContext-*.xml</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> </web-app>
相关文章推荐
- SpringMVC配置web.xml文件详解(列举常用的配置)
- SpringMVC配置web.xml文件详解(列举常用的配置)
- SpringMVC中web.xml的常用配置文件
- java web开发中 web.xml文件的作用及常用配置说明
- SpringMVC配置web.xml文件详解(列举常用的配置)
- Spring常用的web.xml文件配置
- SSH项目web.xml文件的常用配置【struts2的过滤器、spring监听器、解决Hibernate延迟加载问题的过滤器、解决中文乱码的过滤器】
- web.xml配置文件的dtd(http://java.sun.com/dtd/web-app_2_3.dtd)
- J2EE中web.xml的常用配置
- web.xml文件中配置(servlet, spring, filter, listenr)的加载顺序 研究
- 关于web.xml文件的配置
- Tomcat 配置文件web.xml
- Struts2.0配置文件(web.xml)
- Servlet读取web.xml配置文件
- web.xml配置文件祥解
- 为Struts应用配置web.xml文件
- Struts 项目中web.xml文件配置
- 通过读取web.xml文件中的配置参数连接数据库(原)
- java 的 web 服务器 jswdk 的配置文件 webserver.xml
- commons-fileupload在web.xml文件中的配置