<<>> to xref

This commit is contained in:
Rob Winch
2021-08-18 11:15:27 -05:00
parent 26419e2149
commit 764fc4eea6
6 changed files with 24 additions and 24 deletions

View File

@@ -68,7 +68,7 @@ If the `Session` were expired, the result would be null.
A `SessionRepository` is in charge of creating, retrieving, and persisting `Session` instances.
If possible, you should not interact directly with a `SessionRepository` or a `Session`.
Instead, developers should prefer interacting with `SessionRepository` and `Session` indirectly through the <<httpsession,`HttpSession`>> and <<websocket,WebSocket>> integration.
Instead, developers should prefer interacting with `SessionRepository` and `Session` indirectly through the xref:http-session.adoc#httpsession[`HttpSession`] and xref:web-socket.adoc#websocket[WebSocket] integration.
[[api-findbyindexnamesessionrepository]]
== Using `FindByIndexNameSessionRepository`
@@ -110,7 +110,7 @@ include::{docs-test-dir}docs/FindByIndexNameSessionRepositoryTests.java[tags=fin
A `ReactiveSessionRepository` is in charge of creating, retrieving, and persisting `Session` instances in a non-blocking and reactive manner.
If possible, you should not interact directly with a `ReactiveSessionRepository` or a `Session`.
Instead, you should prefer interacting with `ReactiveSessionRepository` and `Session` indirectly through the <<websession,WebSession>> integration.
Instead, you should prefer interacting with `ReactiveSessionRepository` and `Session` indirectly through the xref:web-session.adoc#websession[WebSession] integration.
[[api-enablespringhttpsession]]
== Using `@EnableSpringHttpSession`
@@ -173,7 +173,7 @@ For additional information on how to create a `RedisConnectionFactory`, see the
=== Using `@EnableRedisHttpSession`
In a web environment, the simplest way to create a new `RedisIndexedSessionRepository` is to use `@EnableRedisHttpSession`.
You can find complete example usage in the <<samples>>.
You can find complete example usage in the xref:samples.adoc#samples[].
You can use the following attributes to customize the configuration:
* *maxInactiveIntervalInSeconds*: The amount of time before the session expires, in seconds.
@@ -493,7 +493,7 @@ include::{indexdoc-tests}[tags=new-mapsessionrepository]
[[api-mapsessionrepository-hazelcast]]
=== Using Spring Session and Hazlecast
The <<samples,Hazelcast Sample>> is a complete application that demonstrates how to use Spring Session with Hazelcast.
The xref:samples.adoc#samples[Hazelcast Sample] is a complete application that demonstrates how to use Spring Session with Hazelcast.
To run it, use the following command:
@@ -503,7 +503,7 @@ To run it, use the following command:
----
====
The <<samples,Hazelcast Spring Sample>> is a complete application that demonstrates how to use Spring Session with Hazelcast and Spring Security.
The xref:samples.adoc#samples[Hazelcast Spring Sample] is a complete application that demonstrates how to use Spring Session with Hazelcast and Spring Security.
It includes example Hazelcast `MapListener` implementations that support firing `SessionCreatedEvent`, `SessionDeletedEvent`, and `SessionExpiredEvent`.
@@ -547,7 +547,7 @@ For additional information on how to create and configure `JdbcTemplate` and `Pl
=== Using `@EnableJdbcHttpSession`
In a web environment, the simplest way to create a new `JdbcIndexedSessionRepository` is to use `@EnableJdbcHttpSession`.
You can find complete example usage in the <<samples>>
You can find complete example usage in the xref:samples.adoc#samples[]
You can use the following attributes to customize the configuration:
* *tableName*: The name of database table used by Spring Session to store sessions
@@ -622,7 +622,7 @@ For additional information on how to create and configure Hazelcast instance, se
To use https://hazelcast.org/[Hazelcast] as your backing source for the `SessionRepository`, you can add the `@EnableHazelcastHttpSession` annotation to a `@Configuration` class.
Doing so extends the functionality provided by the `@EnableSpringHttpSession` annotation but makes the `SessionRepository` for you in Hazelcast.
You must provide a single `HazelcastInstance` bean for the configuration to work.
You can find a complete configuration example in the <<samples>>.
You can find a complete configuration example in the xref:samples.adoc#samples[].
[[api-enablehazelcasthttpsession-customize]]
=== Basic Customization
@@ -641,7 +641,7 @@ Using a `MapListener` to respond to entries being added, evicted, and removed fr
Sessions are stored in a distributed `IMap` in Hazelcast.
The `IMap` interface methods are used to `get()` and `put()` Sessions.
Additionally, the `values()` method supports a `FindByIndexNameSessionRepository#findByIndexNameAndIndexValue` operation, together with appropriate `ValueExtractor` (which needs to be registered with Hazelcast). See the <<samples, Hazelcast Spring Sample>> for more details on this configuration.
Additionally, the `values()` method supports a `FindByIndexNameSessionRepository#findByIndexNameAndIndexValue` operation, together with appropriate `ValueExtractor` (which needs to be registered with Hazelcast). See the xref:samples.adoc#samples[ Hazelcast Spring Sample] for more details on this configuration.
The expiration of a session in the `IMap` is handled by Hazelcast's support for setting the time to live on an entry when it is `put()` into the `IMap`. Entries (sessions) that have been idle longer than the time to live are automatically removed from the `IMap`.
You should not need to configure any settings such as `max-idle-seconds` or `time-to-live-seconds` for the `IMap` within the Hazelcast configuration.

View File

@@ -111,7 +111,7 @@ with the same `SerializerConfiguration` of members.
== Servlet Container Initialization
Our <<security-spring-configuration,Spring Configuration>> created a Spring bean named `springSessionRepositoryFilter` that implements `Filter`.
Our xref:guides/java-security.adoc#security-spring-configuration[Spring Configuration] created a Spring bean named `springSessionRepositoryFilter` that implements `Filter`.
The `springSessionRepositoryFilter` bean is responsible for replacing the `HttpSession` with a custom implementation that is backed by Spring Session.
In order for our `Filter` to do its magic, Spring needs to load our `SessionConfig` class.

View File

@@ -26,7 +26,7 @@ You can choose from enabling this by using either:
This section describes how to use Redis to back `HttpSession` by using Java based configuration.
NOTE: The <<samples, HttpSession Sample>> provides a working sample of how to integrate Spring Session and `HttpSession` by using Java configuration.
NOTE: The xref:samples.adoc#samples[ HttpSession Sample] provides a working sample of how to integrate Spring Session and `HttpSession` by using Java configuration.
You can read the basic steps for integration in the next few sections, but we encourage you to follow along with the detailed HttpSession Guide when integrating with your own application.
include::guides/java-redis.adoc[tags=config,leveloffset=+2]
@@ -36,7 +36,7 @@ include::guides/java-redis.adoc[tags=config,leveloffset=+2]
This section describes how to use Redis to back `HttpSession` by using XML based configuration.
NOTE: The <<samples, HttpSession XML Sample>> provides a working sample of how to integrate Spring Session and `HttpSession` using XML configuration.
NOTE: The xref:samples.adoc#samples[ HttpSession XML Sample] provides a working sample of how to integrate Spring Session and `HttpSession` using XML configuration.
You can read the basic steps for integration in the next few sections, but we encourage you to follow along with the detailed HttpSession XML Guide when integrating with your own application.
include::guides/xml-redis.adoc[tags=config,leveloffset=+2]
@@ -56,7 +56,7 @@ You can choose to do in any of the following ways:
This section describes how to use a relational database to back `HttpSession` when you use Java-based configuration.
NOTE: The <<samples, HttpSession JDBC Sample>> provides a working sample of how to integrate Spring Session and `HttpSession` by using Java configuration.
NOTE: The xref:samples.adoc#samples[ HttpSession JDBC Sample] provides a working sample of how to integrate Spring Session and `HttpSession` by using Java configuration.
You can read the basic steps for integration in the next few sections, but we encouraged you to follow along with the detailed HttpSession JDBC Guide when integrating with your own application.
include::guides/java-jdbc.adoc[tags=config,leveloffset=+2]
@@ -66,7 +66,7 @@ include::guides/java-jdbc.adoc[tags=config,leveloffset=+2]
This section describes how to use a relational database to back `HttpSession` when you use XML based configuration.
NOTE: The <<samples, HttpSession JDBC XML Sample>> provides a working sample of how to integrate Spring Session and `HttpSession` by using XML configuration.
NOTE: The xref:samples.adoc#samples[ HttpSession JDBC XML Sample] provides a working sample of how to integrate Spring Session and `HttpSession` by using XML configuration.
You can read the basic steps for integration in the next few sections, but we encourage you to follow along with the detailed HttpSession JDBC XML Guide when integrating with your own application.
include::guides/xml-jdbc.adoc[tags=config,leveloffset=+2]
@@ -76,7 +76,7 @@ include::guides/xml-jdbc.adoc[tags=config,leveloffset=+2]
This section describes how to use a relational database to back `HttpSession` when you use Spring Boot.
NOTE: The <<samples, HttpSession JDBC Spring Boot Sample>> provides a working sample of how to integrate Spring Session and `HttpSession` by using Spring Boot.
NOTE: The xref:samples.adoc#samples[ HttpSession JDBC Spring Boot Sample] provides a working sample of how to integrate Spring Session and `HttpSession` by using Spring Boot.
You can read the basic steps for integration in the next few sections, but we encourage you to follow along with the detailed HttpSession JDBC Spring Boot Guide when integrating with your own application.
include::guides/boot-jdbc.adoc[tags=config,leveloffset=+2]
@@ -88,7 +88,7 @@ Using Spring Session with `HttpSession` is enabled by adding a Servlet Filter be
This section describes how to use Hazelcast to back `HttpSession` by using Java-based configuration.
NOTE: The <<samples, Hazelcast Spring Sample>> provides a working sample of how to integrate Spring Session and `HttpSession` by using Java configuration.
NOTE: The xref:samples.adoc#samples[ Hazelcast Spring Sample] provides a working sample of how to integrate Spring Session and `HttpSession` by using Java configuration.
You can read the basic steps for integration in the next few sections, but we encourage you to follow along with the detailed Hazelcast Spring Guide when integrating with your own application.
include::guides/java-hazelcast.adoc[tags=config,leveloffset=+1]
@@ -158,7 +158,7 @@ This highlights why it is important that Spring Session's `SessionRepositoryFilt
Spring Session can work with RESTful APIs by letting the session be provided in a header.
NOTE: The <<samples, REST Sample>> provides a working sample of how to use Spring Session in a REST application to support authenticating with a header.
NOTE: The xref:samples.adoc#samples[ REST Sample] provides a working sample of how to use Spring Session in a REST application to support authenticating with a header.
You can follow the basic steps for integration described in the next few sections, but we encourage you to follow along with the detailed REST Guide when integrating with your own application.
include::guides/java-rest.adoc[tags=config,leveloffset=+1]

View File

@@ -59,8 +59,8 @@ The minimum requirements for Spring Session are:
* Java 8+.
* If you run in a Servlet Container (not required), Servlet 3.1+.
* If you use other Spring libraries (not required), the minimum required version is Spring 5.0.x.
* `@EnableRedisHttpSession` requires Redis 2.8+. This is necessary to support <<api-redisindexedsessionrepository-expiration,Session Expiration>>
* `@EnableHazelcastHttpSession` requires Hazelcast 3.6+. This is necessary to support <<api-enablehazelcasthttpsession-storage,`FindByIndexNameSessionRepository`>>
* `@EnableRedisHttpSession` requires Redis 2.8+. This is necessary to support xref:api.adoc#api-redisindexedsessionrepository-expiration[Session Expiration]
* `@EnableHazelcastHttpSession` requires Hazelcast 3.6+. This is necessary to support xref:api.adoc#api-enablehazelcasthttpsession-storage[`FindByIndexNameSessionRepository`]
NOTE: At its core, Spring Session has a required dependency only on `spring-jcl`.
For an example of using Spring Session without any other Spring dependencies, see the <<samples,hazelcast sample>> application.
For an example of using Spring Session without any other Spring dependencies, see the xref:samples.adoc#samples[hazelcast sample] application.

View File

@@ -4,6 +4,6 @@
Spring Session provides an API and implementations for managing a user's session information while also making it trivial to support clustered sessions without being tied to an application container-specific solution.
It also provides transparent integration with:
* <<httpsession,HttpSession>>: Allows replacing the `HttpSession` in an application container-neutral way, with support for providing session IDs in headers to work with RESTful APIs.
* <<websocket,WebSocket>>: Provides the ability to keep the `HttpSession` alive when receiving WebSocket messages
* <<websession,WebSession>>: Allows replacing the Spring WebFlux's `WebSession` in an application container-neutral way.
* xref:http-session.adoc#httpsession[HttpSession]: Allows replacing the `HttpSession` in an application container-neutral way, with support for providing session IDs in headers to work with RESTful APIs.
* xref:web-socket.adoc#websocket[WebSocket]: Provides the ability to keep the `HttpSession` alive when receiving WebSocket messages
* xref:web-session.adoc#websession[WebSession]: Allows replacing the Spring WebFlux's `WebSession` in an application container-neutral way.

View File

@@ -21,12 +21,12 @@ This means that, if we are actively chatting in our application and are not usin
[[websocket-usage]]
== WebSocket Usage
The <<samples, WebSocket Sample>> provides a working sample of how to integrate Spring Session with WebSockets.
The xref:samples.adoc#samples[ WebSocket Sample] provides a working sample of how to integrate Spring Session with WebSockets.
You can follow the basic steps for integration described in the next few headings, but we encourage you to follow along with the detailed WebSocket Guide when integrating with your own application.
[[websocket-httpsession]]
=== `HttpSession` Integration
Before using WebSocket integration, you should be sure that you have <<httpsession>> working first.
Before using WebSocket integration, you should be sure that you have xref:http-session.adoc#httpsession[] working first.
include::guides/boot-websocket.adoc[tags=config,leveloffset=+2]