为了账号安全,请及时绑定邮箱和手机立即绑定

web.xml中哪一步设置了网站在每一个多小时就会自动跳转到首页?

web.xml中哪一步设置了网站在每一个多小时就会自动跳转到首页?

一只萌萌小番薯 2019-02-27 18:57:20
<?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贡献1921条经验 获得超9个赞

在web.xml没有这种配置,猜测是最后session-config这里的配置使session失效,验证跳转到登陆页

查看完整回答
反对 回复 2019-03-01
?
繁星淼淼

TA贡献1775条经验 获得超11个赞

优先考虑session超时导致的首页跳转

  1. tomcat的conf/web.xml可以配置,<session-config>标签,一般是30分钟
  2. 项目的web.xml里面可以配置<session-config>标签,你给的里面配的是3000,单位是分钟
  3. java代码可以通过session.setMaxInactiveInterval来配置session超时
  4. 项目里面代码有相关的过滤拦截,你这里有一个checkLoginFilter,看一下里面有没有做判断
    优先级上 4>3>2>1
查看完整回答
反对 回复 2019-03-01
  • 3 回答
  • 0 关注
  • 778 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信