From 592b06404ad18d7d32cd5b269cd91d89c34f0d9d Mon Sep 17 00:00:00 2001 From: Marcus Hert Da Coregio Date: Tue, 23 Jan 2024 09:05:58 -0300 Subject: [PATCH] Documentation links should use variable for reference docs url Closes gh-2761 --- spring-session-docs/modules/ROOT/pages/api.adoc | 6 +++--- .../modules/ROOT/pages/configuration/redis.adoc | 2 +- .../modules/ROOT/pages/guides/boot-jdbc.adoc | 4 ++-- .../modules/ROOT/pages/guides/boot-mongo.adoc | 2 +- .../modules/ROOT/pages/guides/boot-redis.adoc | 4 ++-- .../modules/ROOT/pages/guides/java-jdbc.adoc | 2 +- .../modules/ROOT/pages/guides/java-redis.adoc | 2 +- .../modules/ROOT/pages/guides/java-rest.adoc | 2 +- .../modules/ROOT/pages/guides/java-security.adoc | 2 +- spring-session-docs/modules/ROOT/pages/guides/xml-jdbc.adoc | 6 +++--- .../modules/ROOT/pages/guides/xml-redis.adoc | 6 +++--- spring-session-docs/modules/ROOT/pages/spring-security.adoc | 2 +- spring-session-docs/modules/ROOT/pages/web-session.adoc | 4 ++-- spring-session-docs/spring-session-docs.gradle | 6 ++++-- 14 files changed, 26 insertions(+), 24 deletions(-) diff --git a/spring-session-docs/modules/ROOT/pages/api.adoc b/spring-session-docs/modules/ROOT/pages/api.adoc index 0a3060a8..c5a5d5d1 100644 --- a/spring-session-docs/modules/ROOT/pages/api.adoc +++ b/spring-session-docs/modules/ROOT/pages/api.adoc @@ -1,7 +1,7 @@ [[api]] = API Documentation -You can browse the complete https://docs.spring.io/spring-session/docs/{spring-session-version}/api/[Javadoc] online. The key APIs are described in the following sections: +You can browse the complete {docs-url}/spring-session/docs/{spring-session-version}/api/[Javadoc] online. The key APIs are described in the following sections: * <> * <> @@ -262,7 +262,7 @@ You can customize the serialization by creating a bean named `springSessionDefau `RedisIndexedSessionRepository` is subscribed to receive events from Redis by using a `RedisMessageListenerContainer`. You can customize the way those events are dispatched by creating a bean named `springSessionRedisTaskExecutor`, a bean `springSessionRedisSubscriptionExecutor`, or both. -You can find more details on configuring Redis task executors https://docs.spring.io/spring-data-redis/docs/{spring-data-redis-version}/reference/html/#redis:pubsub:subscribe:containers[here]. +You can find more details on configuring Redis task executors {docs-url}/spring-data-redis/docs/{spring-data-redis-version}/reference/html/#redis:pubsub:subscribe:containers[here]. [[api-redisindexedsessionrepository-storage]] === Storage Details @@ -614,7 +614,7 @@ include::{indexdoc-tests}[tags=new-jdbcindexedsessionrepository] ---- ==== -For additional information on how to create and configure `JdbcTemplate` and `PlatformTransactionManager`, see the https://docs.spring.io/spring/docs/{spring-core-version}/spring-framework-reference/data-access.html[Spring Framework Reference Documentation]. +For additional information on how to create and configure `JdbcTemplate` and `PlatformTransactionManager`, see the {docs-url}/spring/docs/{spring-core-version}/spring-framework-reference/data-access.html[Spring Framework Reference Documentation]. [[api-jdbcindexedsessionrepository-config]] === Using `@EnableJdbcHttpSession` diff --git a/spring-session-docs/modules/ROOT/pages/configuration/redis.adoc b/spring-session-docs/modules/ROOT/pages/configuration/redis.adoc index c2474062..1020dd36 100644 --- a/spring-session-docs/modules/ROOT/pages/configuration/redis.adoc +++ b/spring-session-docs/modules/ROOT/pages/configuration/redis.adoc @@ -208,7 +208,7 @@ In order to be able to do that, you must be using the <>. With the indexed repository configured, you can now start to listen to `SessionCreatedEvent`, `SessionDeletedEvent`, `SessionDestroyedEvent` and `SessionExpiredEvent` events. -There are a https://docs.spring.io/spring-framework/reference/core/beans/context-introduction.html#context-functionality-events[few ways to listen to application events] in Spring, we are going to use the `@EventListener` annotation. +There are a {docs-url}/spring-framework/reference/core/beans/context-introduction.html#context-functionality-events[few ways to listen to application events] in Spring, we are going to use the `@EventListener` annotation. ==== [source,java] diff --git a/spring-session-docs/modules/ROOT/pages/guides/boot-jdbc.adoc b/spring-session-docs/modules/ROOT/pages/guides/boot-jdbc.adoc index c3cb4129..835d6399 100644 --- a/spring-session-docs/modules/ROOT/pages/guides/boot-jdbc.adoc +++ b/spring-session-docs/modules/ROOT/pages/guides/boot-jdbc.adoc @@ -71,7 +71,7 @@ spring.session.jdbc.table-name=SPRING_SESSION # Name of the database table used ---- ==== -For more information, see the https://docs.spring.io/spring-boot/docs/{spring-boot-version}/reference/htmlsingle/#boot-features-session[Spring Session] portion of the Spring Boot documentation. +For more information, see the {docs-url}/spring-boot/docs/{spring-boot-version}/reference/htmlsingle/#boot-features-session[Spring Session] portion of the Spring Boot documentation. [[httpsession-jdbc-boot-configuration]] == Configuring the `DataSource` @@ -89,7 +89,7 @@ spring.datasource.password= # Login password of the database. ---- ==== -For more information, see the https://docs.spring.io/spring-boot/docs/{spring-boot-version}/reference/htmlsingle/#boot-features-configure-datasource[Configure a DataSource] portion of the Spring Boot documentation. +For more information, see the {docs-url}/spring-boot/docs/{spring-boot-version}/reference/htmlsingle/#boot-features-configure-datasource[Configure a DataSource] portion of the Spring Boot documentation. [[httpsession-jdbc-boot-servlet-configuration]] == Servlet Container Initialization diff --git a/spring-session-docs/modules/ROOT/pages/guides/boot-mongo.adoc b/spring-session-docs/modules/ROOT/pages/guides/boot-mongo.adoc index e03f539a..05d3a1f6 100644 --- a/spring-session-docs/modules/ROOT/pages/guides/boot-mongo.adoc +++ b/spring-session-docs/modules/ROOT/pages/guides/boot-mongo.adoc @@ -103,7 +103,7 @@ spring.data.mongodb.database=prod ---- ==== -For more information, refer to https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-connecting-to-mongodb[Connecting to MongoDB] portion of the Spring Boot documentation. +For more information, refer to {docs-url}/spring-boot/docs/current/reference/htmlsingle/#boot-features-connecting-to-mongodb[Connecting to MongoDB] portion of the Spring Boot documentation. [[boot-servlet-configuration]] == Servlet Container Initialization diff --git a/spring-session-docs/modules/ROOT/pages/guides/boot-redis.adoc b/spring-session-docs/modules/ROOT/pages/guides/boot-redis.adoc index a2d0297f..3dc5f045 100644 --- a/spring-session-docs/modules/ROOT/pages/guides/boot-redis.adoc +++ b/spring-session-docs/modules/ROOT/pages/guides/boot-redis.adoc @@ -68,7 +68,7 @@ spring.session.redis.namespace=spring:session # Namespace for keys used to store ---- ==== -For more information, see the https://docs.spring.io/spring-boot/docs/{spring-boot-version}/reference/htmlsingle/#boot-features-session[Spring Session] portion of the Spring Boot documentation. +For more information, see the {docs-url}/spring-boot/docs/{spring-boot-version}/reference/htmlsingle/#boot-features-session[Spring Session] portion of the Spring Boot documentation. [[boot-redis-configuration]] == Configuring the Redis Connection @@ -86,7 +86,7 @@ spring.data.redis.port=6379 # Redis server port. ---- ==== -For more information, see the https://docs.spring.io/spring-boot/docs/{spring-boot-version}/reference/htmlsingle/#boot-features-connecting-to-redis[Connecting to Redis] portion of the Spring Boot documentation. +For more information, see the {docs-url}/spring-boot/docs/{spring-boot-version}/reference/htmlsingle/#boot-features-connecting-to-redis[Connecting to Redis] portion of the Spring Boot documentation. [[boot-servlet-configuration]] == Servlet Container Initialization diff --git a/spring-session-docs/modules/ROOT/pages/guides/java-jdbc.adoc b/spring-session-docs/modules/ROOT/pages/guides/java-jdbc.adoc index be5ccc9d..64b4bdf6 100644 --- a/spring-session-docs/modules/ROOT/pages/guides/java-jdbc.adoc +++ b/spring-session-docs/modules/ROOT/pages/guides/java-jdbc.adoc @@ -100,7 +100,7 @@ We configure the H2 database to create database tables by using the SQL script t <3> We create a `transactionManager` that manages transactions for previously configured `dataSource`. ==== -For additional information on how to configure data access related concerns, see the https://docs.spring.io/spring/docs/{spring-core-version}/reference/html/data-access.html[Spring Framework Reference Documentation]. +For additional information on how to configure data access related concerns, see the {docs-url}/spring/docs/{spring-core-version}/reference/html/data-access.html[Spring Framework Reference Documentation]. == Java Servlet Container Initialization diff --git a/spring-session-docs/modules/ROOT/pages/guides/java-redis.adoc b/spring-session-docs/modules/ROOT/pages/guides/java-redis.adoc index 31b82d0b..cb432a9a 100644 --- a/spring-session-docs/modules/ROOT/pages/guides/java-redis.adoc +++ b/spring-session-docs/modules/ROOT/pages/guides/java-redis.adoc @@ -101,7 +101,7 @@ The filter is in charge of replacing the `HttpSession` implementation to be back In this instance, Spring Session is backed by Redis. <2> We create a `RedisConnectionFactory` that connects Spring Session to the Redis Server. We configure the connection to connect to localhost on the default port (6379). -For more information on configuring Spring Data Redis, see the https://docs.spring.io/spring-data/data-redis/docs/{spring-data-redis-version}/reference/html/[reference documentation]. +For more information on configuring Spring Data Redis, see the {docs-url}/spring-data/data-redis/docs/{spring-data-redis-version}/reference/html/[reference documentation]. ==== == Java Servlet Container Initialization diff --git a/spring-session-docs/modules/ROOT/pages/guides/java-rest.adoc b/spring-session-docs/modules/ROOT/pages/guides/java-rest.adoc index 3b69c049..08bd8797 100644 --- a/spring-session-docs/modules/ROOT/pages/guides/java-rest.adoc +++ b/spring-session-docs/modules/ROOT/pages/guides/java-rest.adoc @@ -101,7 +101,7 @@ The filter is in charge of replacing the `HttpSession` implementation to be back In this instance, Spring Session is backed by Redis. <2> We create a `RedisConnectionFactory` that connects Spring Session to the Redis Server. We configure the connection to connect to localhost on the default port (6379). -For more information on configuring Spring Data Redis, see the https://docs.spring.io/spring-data/data-redis/docs/{spring-data-redis-version}/reference/html/[reference documentation]. +For more information on configuring Spring Data Redis, see the {docs-url}/spring-data/data-redis/docs/{spring-data-redis-version}/reference/html/[reference documentation]. <3> We customize Spring Session's HttpSession integration to use HTTP headers to convey the current session information instead of cookies. ==== diff --git a/spring-session-docs/modules/ROOT/pages/guides/java-security.adoc b/spring-session-docs/modules/ROOT/pages/guides/java-security.adoc index a4867f0b..fe2e5b73 100644 --- a/spring-session-docs/modules/ROOT/pages/guides/java-security.adoc +++ b/spring-session-docs/modules/ROOT/pages/guides/java-security.adoc @@ -99,7 +99,7 @@ The filter is in charge of replacing the `HttpSession` implementation to be back In this instance Spring Session is backed by Redis. <2> We create a `RedisConnectionFactory` that connects Spring Session to the Redis Server. We configure the connection to connect to localhost on the default port (6379) -For more information on configuring Spring Data Redis, see the https://docs.spring.io/spring-data/data-redis/docs/{spring-data-redis-version}/reference/html/[reference documentation]. +For more information on configuring Spring Data Redis, see the {docs-url}/spring-data/data-redis/docs/{spring-data-redis-version}/reference/html/[reference documentation]. ==== == Servlet Container Initialization diff --git a/spring-session-docs/modules/ROOT/pages/guides/xml-jdbc.adoc b/spring-session-docs/modules/ROOT/pages/guides/xml-jdbc.adoc index 531d74f9..2b049713 100644 --- a/spring-session-docs/modules/ROOT/pages/guides/xml-jdbc.adoc +++ b/spring-session-docs/modules/ROOT/pages/guides/xml-jdbc.adoc @@ -102,7 +102,7 @@ We configure the H2 database to create database tables by using the SQL script t <3> We create a `transactionManager` that manages transactions for previously configured `dataSource`. ==== -For additional information on how to configure data access-related concerns, see the https://docs.spring.io/spring/docs/{spring-core-version}/spring-framework-reference/data-access.html[Spring Framework Reference Documentation]. +For additional information on how to configure data access-related concerns, see the {docs-url}/spring/docs/{spring-core-version}/spring-framework-reference/data-access.html[Spring Framework Reference Documentation]. == XML Servlet Container Initialization @@ -121,7 +121,7 @@ include::{samples-dir}spring-session-sample-xml-jdbc/src/main/webapp/WEB-INF/web ---- ==== -The https://docs.spring.io/spring/docs/{spring-core-version}/spring-framework-reference/core.html#context-create[`ContextLoaderListener`] reads the `contextConfigLocation` and picks up our session.xml configuration. +The {docs-url}/spring/docs/{spring-core-version}/spring-framework-reference/core.html#context-create[`ContextLoaderListener`] reads the `contextConfigLocation` and picks up our session.xml configuration. Last, we need to ensure that our Servlet Container (that is, Tomcat) uses our `springSessionRepositoryFilter` for every request. The following snippet performs this last step for us: @@ -134,7 +134,7 @@ include::{samples-dir}spring-session-sample-xml-jdbc/src/main/webapp/WEB-INF/web ---- ==== -The https://docs.spring.io/spring-framework/docs/{spring-core-version}/javadoc-api/org/springframework/web/filter/DelegatingFilterProxy.html[`DelegatingFilterProxy`] looks up a bean named `springSessionRepositoryFilter` and casts it to a `Filter`. +The {docs-url}/spring-framework/docs/{spring-core-version}/javadoc-api/org/springframework/web/filter/DelegatingFilterProxy.html[`DelegatingFilterProxy`] looks up a bean named `springSessionRepositoryFilter` and casts it to a `Filter`. For every request on which `DelegatingFilterProxy` is invoked, the `springSessionRepositoryFilter` is invoked. // end::config[] diff --git a/spring-session-docs/modules/ROOT/pages/guides/xml-redis.adoc b/spring-session-docs/modules/ROOT/pages/guides/xml-redis.adoc index 7b8595ff..c3673f84 100644 --- a/spring-session-docs/modules/ROOT/pages/guides/xml-redis.adoc +++ b/spring-session-docs/modules/ROOT/pages/guides/xml-redis.adoc @@ -102,7 +102,7 @@ The filter is in charge of replacing the `HttpSession` implementation to be back In this instance, Spring Session is backed by Redis. <2> We create a `RedisConnectionFactory` that connects Spring Session to the Redis Server. We configure the connection to connect to localhost on the default port (6379) -For more information on configuring Spring Data Redis, see the https://docs.spring.io/spring-data/data-redis/docs/{spring-data-redis-version}/reference/html/[reference documentation]. +For more information on configuring Spring Data Redis, see the {docs-url}/spring-data/data-redis/docs/{spring-data-redis-version}/reference/html/[reference documentation]. ==== == XML Servlet Container Initialization @@ -122,7 +122,7 @@ include::{samples-dir}spring-session-sample-xml-redis/src/main/webapp/WEB-INF/we ---- ==== -The https://docs.spring.io/spring/docs/{spring-core-version}/spring-framework-reference/core.html#context-create[`ContextLoaderListener`] reads the contextConfigLocation and picks up our session.xml configuration. +The {docs-url}/spring/docs/{spring-core-version}/spring-framework-reference/core.html#context-create[`ContextLoaderListener`] reads the contextConfigLocation and picks up our session.xml configuration. Last, we need to ensure that our Servlet Container (that is, Tomcat) uses our `springSessionRepositoryFilter` for every request. The following snippet performs this last step for us: @@ -135,7 +135,7 @@ include::{samples-dir}spring-session-sample-xml-redis/src/main/webapp/WEB-INF/we ---- ==== -The https://docs.spring.io/spring-framework/docs/{spring-core-version}/javadoc-api/org/springframework/web/filter/DelegatingFilterProxy.html[`DelegatingFilterProxy`] looks up a Bean by the name of `springSessionRepositoryFilter` and cast it to a `Filter`. +The {docs-url}/spring-framework/docs/{spring-core-version}/javadoc-api/org/springframework/web/filter/DelegatingFilterProxy.html[`DelegatingFilterProxy`] looks up a Bean by the name of `springSessionRepositoryFilter` and cast it to a `Filter`. For every request that `DelegatingFilterProxy` is invoked, the `springSessionRepositoryFilter` is invoked. // end::config[] diff --git a/spring-session-docs/modules/ROOT/pages/spring-security.adoc b/spring-session-docs/modules/ROOT/pages/spring-security.adoc index ea45e49e..1b9b53a9 100644 --- a/spring-session-docs/modules/ROOT/pages/spring-security.adoc +++ b/spring-session-docs/modules/ROOT/pages/spring-security.adoc @@ -6,7 +6,7 @@ Spring Session provides integration with Spring Security. [[spring-security-rememberme]] == Spring Security Remember-me Support -Spring Session provides integration with https://docs.spring.io/spring-security/site/docs/{spring-security-core-version}/reference/html5/#servlet-rememberme[Spring Security's Remember-me Authentication]. +Spring Session provides integration with {docs-url}/spring-security/site/docs/{spring-security-core-version}/reference/html5/#servlet-rememberme[Spring Security's Remember-me Authentication]. The support: * Changes the session expiration length diff --git a/spring-session-docs/modules/ROOT/pages/web-session.adoc b/spring-session-docs/modules/ROOT/pages/web-session.adoc index 346747d9..37665cd7 100644 --- a/spring-session-docs/modules/ROOT/pages/web-session.adoc +++ b/spring-session-docs/modules/ROOT/pages/web-session.adoc @@ -37,7 +37,7 @@ This is what is in charge of replacing the `WebSession` implementation to be bac In this instance, Spring Session is backed by Redis. <2> We create a `RedisConnectionFactory` that connects Spring Session to the Redis Server. We configure the connection to connect to localhost on the default port (6379) -For more information on configuring Spring Data Redis, see the https://docs.spring.io/spring-data/data-redis/docs/{spring-data-redis-version}/reference/html/[reference documentation]. +For more information on configuring Spring Data Redis, see the {docs-url}/spring-data/data-redis/docs/{spring-data-redis-version}/reference/html/[reference documentation]. ==== [[websession-how]] @@ -113,4 +113,4 @@ public class SpringSessionWebSessionStore implements WebSessi ==== To be detected by Spring WebFlux, this custom `WebSessionStore` needs to be registered with `ApplicationContext` as a bean named `webSessionManager`. -For additional information on Spring WebFlux, see the https://docs.spring.io/spring-framework/docs/{spring-core-version}/reference/html/web-reactive.html[Spring Framework Reference Documentation]. +For additional information on Spring WebFlux, see the {docs-url}/spring-framework/docs/{spring-core-version}/reference/html/web-reactive.html[Spring Framework Reference Documentation]. diff --git a/spring-session-docs/spring-session-docs.gradle b/spring-session-docs/spring-session-docs.gradle index f083d44e..03e42d15 100644 --- a/spring-session-docs/spring-session-docs.gradle +++ b/spring-session-docs/spring-session-docs.gradle @@ -54,11 +54,13 @@ def generateAttributes() { ? springBootVersion.substring(0, springBootVersion.indexOf("-")) : springBootVersion def ghTag = snapshotBuild ? 'main' : project.version - def springBootRefDocs = "https://docs.spring.io/spring-boot/docs/${springBootVersion}/reference/html" + def docsUrl = 'https://docs.spring.io' + def springBootRefDocs = "${docsUrl}/spring-boot/docs/${springBootVersion}/reference/html" return ['gh-tag':ghTag, 'spring-boot-version': springBootVersion, 'spring-boot-ref-docs': springBootRefDocs.toString(), - 'spring-session-version': project.version] + 'spring-session-version': project.version, + 'docs-url': docsUrl] } sourceSets {