首页 > 解决方案 > 防止应用程序自动注销

问题描述

我正在使用spring boot java web-application,登录后,如果有任何不活动,它会在一段时间后注销,我该如何停止呢?请帮忙。

标签: javaangularjsspring-bootweb-applicationssign

解决方案


您需要指定会话超时发生多长时间,因为您已经体验到最简单的解决方法是在 WEB-INF 中找到 web.xml 文件并更改或删除给定的超时量。如果由于某种原因它被删除或不存在,请使用以下内容重新制作 WEB-INF 目录中的 web.xml 文件。

<?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"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
    http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
        id="WebApp_ID" version="3.0">
   
  <display-name>YourWebAppName</display-name>
   
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>
   
  <session-config>
    <session-timeout>15</session-timeout>
  </session-config>
   
</web-app>

推荐阅读