mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Merge branch '2.2.x' into 2.3.x
Closes gh-23750
This commit is contained in:
commit
a754b791a2
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2012-2019 the original author or authors.
|
* Copyright 2012-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -22,8 +22,6 @@ import java.util.Arrays;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.ObjectProvider;
|
import org.springframework.beans.factory.ObjectProvider;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.autoconfigure.web.ServerProperties;
|
import org.springframework.boot.autoconfigure.web.ServerProperties;
|
||||||
@ -64,13 +62,6 @@ public class SessionProperties {
|
|||||||
this.serverProperties = serverProperties.getIfUnique();
|
this.serverProperties = serverProperties.getIfUnique();
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostConstruct
|
|
||||||
public void checkSessionTimeout() {
|
|
||||||
if (this.timeout == null && this.serverProperties != null) {
|
|
||||||
this.timeout = this.serverProperties.getServlet().getSession().getTimeout();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public StoreType getStoreType() {
|
public StoreType getStoreType() {
|
||||||
return this.storeType;
|
return this.storeType;
|
||||||
}
|
}
|
||||||
@ -85,7 +76,8 @@ public class SessionProperties {
|
|||||||
* @see Session#getTimeout()
|
* @see Session#getTimeout()
|
||||||
*/
|
*/
|
||||||
public Duration getTimeout() {
|
public Duration getTimeout() {
|
||||||
return this.timeout;
|
return (this.timeout == null && this.serverProperties != null)
|
||||||
|
? this.serverProperties.getServlet().getSession().getTimeout() : this.timeout;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTimeout(Duration timeout) {
|
public void setTimeout(Duration timeout) {
|
||||||
|
Loading…
Reference in New Issue
Block a user