web.xml

简介: ssm框架中web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"

     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
     version="4.0">

<!--DispatcherServlet-->
<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:applicationContext.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>DispatcherServlet</servlet-name>
    <url-pattern>/</url-pattern>
</servlet-mapping>

<!--encodingFilter-->
<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>
</filter>
<filter-mapping>
    <filter-name>encodingFilter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

<!--Session过期时间-->
<session-config>
    <session-timeout>30</session-timeout>
</session-config>

相关文章
|
10月前
|
JavaScript Java Spring
web.xml中/和/*的区别
web.xml中/和/*的区别
|
10月前
|
XML 安全 IDE
web.xml 总结
web.xml 总结
Servlet配置web.xml
Servlet配置web.xml
90 0
|
XML 数据格式
web.xml内容如下
web.xml内容如下
83 0
|
Java 前端开发 数据格式
|
XML 前端开发 JavaScript
SpringMVC之web.xml,了解必要配置项
SpringMVC之web.xml,了解必要配置项
232 0
SpringMVC之web.xml,了解必要配置项
|
fastjson 容器 druid
JettyServer无web.xml
JettyServer无web.xml启动
1573 0
|
容器 应用服务中间件 Java