上传时Vaadin会话超时

时间:2017-05-30 03:59:35

标签: spring spring-boot vaadin8

我正在使用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();
}

1 个答案:

答案 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>