<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
metadata-complete="true" version="3.0">
<!-- Context ConfigLocation -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:spring.xml,classpath:spring-mybatis.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<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>
<!--CORS跨域请求过滤-->
<filter>
<filter-name>CORSFilter</filter-name>
<filter-class>com.lqb.web.filter.CORSFilter</filter-class>
<init-param>
<param-name>allowDomain</param-name>
<param-value>null,file://</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CORSFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- 登录校验 -->
<filter>
<filter-name>checkLoginFilter</filter-name>
<filter-class>com.lqb.web.filter.CheckLoginFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>checkLoginFilter</filter-name>
<url-pattern>/remind/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>checkLoginFilter</filter-name>
<url-pattern>/authority/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>checkLoginFilter</filter-name>
<url-pattern>/buildingmanagement/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>checkLoginFilter</filter-name>
<url-pattern>/resource/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>checkLoginFilter</filter-name>
<url-pattern>/homepage.html</url-pattern>
</filter-mapping>
<!--<filter-mapping>-->
<!--<filter-name>checkLoginFilter</filter-name>-->
<!--<url-pattern>/app/contract/*</url-pattern>-->
<!--</filter-mapping>-->
<!--<filter-mapping>-->
<!--<filter-name>checkLoginFilter</filter-name>-->
<!--<url-pattern>/app/data/*</url-pattern>-->
<!--</filter-mapping>-->
<!--<filter-mapping>-->
<!--<filter-name>checkLoginFilter</filter-name>-->
<!--<url-pattern>/app/mansion/*</url-pattern>-->
<!--</filter-mapping>-->
<!--<filter-mapping>-->
<!--<filter-name>checkLoginFilter</filter-name>-->
<!--<url-pattern>/app/permission/*</url-pattern>-->
<!--</filter-mapping>-->
<!--<filter-mapping>-->
<!--<filter-name>checkLoginFilter</filter-name>-->
<!--<url-pattern>/app/remind/*</url-pattern>-->
<!--</filter-mapping>-->
<!--<filter-mapping>-->
<!--<filter-name>checkLoginFilter</filter-name>-->
<!--<url-pattern>/app/source/*</url-pattern>-->
<!--</filter-mapping>-->
<!--<filter-mapping>-->
<!--<filter-name>checkLoginFilter</filter-name>-->
<!--<url-pattern>/app/system/*</url-pattern>-->
<!--</filter-mapping>-->
<!--<filter-mapping>-->
<!--<filter-name>checkLoginFilter</filter-name>-->
<!--<url-pattern>/app/upload/*</url-pattern>-->
<!--</filter-mapping>-->
<!--<filter-mapping>-->
<!--<filter-name>checkLoginFilter</filter-name>-->
<!--<url-pattern>/app/user/loginOut</url-pattern>-->
<!--</filter-mapping>-->
<!--<filter-mapping>-->
<!--<filter-name>checkLoginFilter</filter-name>-->
<!--<url-pattern>/app/user/getUserInfo</url-pattern>-->
<!--</filter-mapping>-->
<!--<filter-mapping>-->
<!--<filter-name>checkLoginFilter</filter-name>-->
<!--<url-pattern>/app/user/updateUse</url-pattern>-->
<!--</filter-mapping>-->
<servlet>
<servlet-name>springServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:/spring*.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<!--<servlet>-->
<!--<servlet-name>log4jconfigfile</servlet-name>-->
<!--<servlet-class>Log4jInitServlet</servlet-class>-->
<!--<init-param>-->
<!--<param-name>configfile</param-name>-->
<!--<param-value>classpath*:/log4j.properties</param-value>-->
<!--</init-param>-->
<!--<load-on-startup>1</load-on-startup>-->
<!--</servlet>-->
<!--<servlet-mapping>-->
<!--<servlet-name>log4jconfigfile</servlet-name>-->
<!--<url-pattern>/app/</url-pattern>-->
<!--</servlet-mapping>-->
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<session-config>
<session-timeout>3000</session-timeout>
</session-config>
</web-app>
3 回答
繁星淼淼
TA贡献1775条经验 获得超11个赞
优先考虑session超时导致的首页跳转
- tomcat的conf/web.xml可以配置,<session-config>标签,一般是30分钟
- 项目的web.xml里面可以配置<session-config>标签,你给的里面配的是3000,单位是分钟
- java代码可以通过session.setMaxInactiveInterval来配置session超时
- 项目里面代码有相关的过滤拦截,你这里有一个checkLoginFilter,看一下里面有没有做判断
优先级上 4>3>2>1
添加回答
举报
0/150
提交
取消