Skip to content

Commit 2f280b0

Browse files
committed
Improve Spring Session back-off documentation
Closes gh-23151
1 parent 35bff55 commit 2f280b0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5922,11 +5922,15 @@ When building a Servlet web application, the following stores can be auto-config
59225922
* Hazelcast
59235923
* MongoDB
59245924

5925+
The Servlet auto-configuration replaces the need to use `@Enable*HttpSession`.
5926+
59255927
When building a reactive web application, the following stores can be auto-configured:
59265928

59275929
* Redis
59285930
* MongoDB
59295931

5932+
The reactive auto-configuration replaces the need to use `@Enable*WebSession`.
5933+
59305934
If a single Spring Session module is present on the classpath, Spring Boot uses that store implementation automatically.
59315935
If you have more than one implementation, you must choose the {spring-boot-autoconfigure-module-code}/session/StoreType.java[`StoreType`] that you wish to use to store the sessions.
59325936
For instance, to use JDBC as the back-end store, you can configure your application as follows:
@@ -5949,6 +5953,10 @@ For instance, it is possible to customize the name of the table for the JDBC sto
59495953
For setting the timeout of the session you can use the configprop:spring.session.timeout[] property.
59505954
If that property is not set, the auto-configuration falls back to the value of configprop:server.servlet.session.timeout[].
59515955

5956+
You can take control over Spring Session's configuration using `@Enable*HttpSession` (Servlet) or `@Enable@WebSession` (Reactive).
5957+
This will cause the auto-configuratio to back off.
5958+
Spring Session can then be configured using the annotation's attributes rather than the previously described configuration properties.
5959+
59525960

59535961

59545962
[[boot-features-jmx]]

0 commit comments

Comments
 (0)