diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java index 0855fb59d9..7fdab453c7 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java @@ -52,6 +52,7 @@ import org.springframework.boot.context.embedded.tomcat.TomcatContextCustomizer; import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory; import org.springframework.boot.context.embedded.undertow.UndertowEmbeddedServletContainerFactory; import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.DeprecatedConfigurationProperty; import org.springframework.boot.context.properties.NestedConfigurationProperty; import org.springframework.core.Ordered; import org.springframework.util.StringUtils; @@ -197,6 +198,17 @@ public class ServerProperties implements EmbeddedServletContainerCustomizer, Ord this.address = address; } + /** + * Set the session timeout + * @return the session timeout + * @deprecated since 1.3.0 in favor of {@code session.timeout}. + */ + @Deprecated + @DeprecatedConfigurationProperty(replacement = "server.session.timeout") + public Integer getSessionTimeout() { + return this.session.getTimeout(); + } + /** * Get the session timeout * @param sessionTimeout the session timeout diff --git a/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 8a0aaa1a0f..0efb458f13 100644 --- a/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -161,15 +161,6 @@ "deprecation": { "replacement": "spring.mvc.view.suffix" } - }, - { - "name": "server.session-timeout", - "type": "java.lang.Integer", - "description": "Session timeout in seconds.", - "sourceType": "org.springframework.boot.autoconfigure.web.ServerProperties", - "deprecation": { - "replacement": "server.session.timeout" - } } ],"hints": [ {