我正在使用Spring Boot 1.5.3.RELEASE和Vaadin 8.0.6。我也在使用Spring Security。我注意到每次使用Upload组件上传文件时,都会收到Session Expired消息。有没有办法配置以避免到期?我做了这个改变但没有帮助“
@Bean
MultipartConfigElement multipartConfigElement() {
MultipartConfigFactory factory = new MultipartConfigFactory();
factory.setMaxFileSize(10 * 1024 * 1024);
factory.setMaxRequestSize(10 * 1024 * 1024);
factory.setFileSizeThreshold(10 * 1024 * 1024);
return factory.createMultipartConfig();
}
答案 0 :(得分:0)
对于Spring Boot 1.4及以上版本:
在 src / main / resources / application.properties 中放置。
添加 server.session.timeout =#会话超时,以秒为单位。
在https://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html
参考与seeion相关的所有属性也请尝试以下,
在web.xml中添加以下会话配置。
<session-config>
<session-timeout>20</session-timeout>
</session-config>