如何判断session超时
程序员文章站
2022-07-13 17:27:44
...
<filter>
<filter-name>Session Timeout Filter</filter-name>
<filter-class>com.vstsoft.common.filter.SessionTimeoutFilter</filter-class>
<init-param>
<param-name>redirectURL</param-name>
<param-value>/loginOut.jsp</param-value>
</init-param>
<init-param>
<param-name>exceptFiles</param-name>
<param-value>
/#/login.jsp#/loginOut.jsp
</param-value>
</init-param>
<init-param>
<param-name>enable</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>Session Timeout Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<session-config>
<session-timeout>30</session-timeout>
</session-config>
把这段放到web.xml中就可以了
详细内容查看Session Timeout Filter