使用ssm框架在web.xml中的基本配置信息
2017-11-07 10:10
459 查看
<?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" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
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>CRM_11</display-name>
<!--使用的tomcat服务器进行session复制 -->
<distributable />
<!--Spring配置文件信息 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!--springMVC配置文件信息 -->
<servlet>
<servlet-name>crm_11</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:context-dispathcer.xml</param-value>
</init-param>
<!-- 启用即加载 -->
<load-on-startup>1</load-on-startup>
</servlet>
<!-- encodeing编码 -->
<filter>
<filter-name>encodingFilter</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>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>*</url-pattern>
</filter-mapping>
<!-- 请求后缀拦截,do结尾的请求是用于后台管理系统,htm结尾的请求,用于前端界面请求 -->
<servlet-mapping>
<servlet-name>crm_11</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<!-- 404、500 -->
<error-page>
<error-code>404</error-code>
<location>/404.do</location><!-- 页面跳转地址 -->
</error-page>
<error-page>
<error-code>500</error-code>
<location>/500.do</location><!-- 页面跳转地址 -->
</error-page>
<!-- session有效期 -->
<session-config>
<session-timeout>120</session-timeout><!-- 默认分钟 -->
</session-config>
</web-app>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
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>CRM_11</display-name>
<!--使用的tomcat服务器进行session复制 -->
<distributable />
<!--Spring配置文件信息 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!--springMVC配置文件信息 -->
<servlet>
<servlet-name>crm_11</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:context-dispathcer.xml</param-value>
</init-param>
<!-- 启用即加载 -->
<load-on-startup>1</load-on-startup>
</servlet>
<!-- encodeing编码 -->
<filter>
<filter-name>encodingFilter</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>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>*</url-pattern>
</filter-mapping>
<!-- 请求后缀拦截,do结尾的请求是用于后台管理系统,htm结尾的请求,用于前端界面请求 -->
<servlet-mapping>
<servlet-name>crm_11</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<!-- 404、500 -->
<error-page>
<error-code>404</error-code>
<location>/404.do</location><!-- 页面跳转地址 -->
</error-page>
<error-page>
<error-code>500</error-code>
<location>/500.do</location><!-- 页面跳转地址 -->
</error-page>
<!-- session有效期 -->
<session-config>
<session-timeout>120</session-timeout><!-- 默认分钟 -->
</session-config>
</web-app>
相关文章推荐
- SSM框架web.xml配置
- 最全三大框架整合(使用映射)——struts.xml和web.xml配置
- JAVA_WEB项目之使用Spring的xml配置方式在项目中管理Lucene检索框架
- ssm框架下web项目,web.xml配置文件的作用(详解)
- ssm框架web.xml中filter配置问题
- ssm的web.xml 配置信息
- ssm整合基本配置之web.xml
- 【SSM整合】-三框架整合xml文件结构及相应web.xml配置
- ssm框架创建简单的DVD管理系统(三)bootstrap的导入和web.xml及spring mvc配置
- SSM/Web.xml配置信息
- 使用SSM框架搭建web项目配置步骤
- ssm框架整合配置---web.xml,傻傻分不清楚
- java ssm框架入门(三)正式项目的web.xml配置
- 在web.xml文件中配置信息,未起作用问题解决
- web.xml文件的作用及基本配置
- web.xml文件的作用及基本配置
- [转]ASP.NET Web.config配置文件的基本使用方法
- web.xml的基本配置
- WEB.xml文件的基本配置
- ASP.NET Web.config配置文件的基本使用方法