From 3f2364312132b65fa12841e7392a01bf38d361c3 Mon Sep 17 00:00:00 2001 From: Rob Winch Date: Thu, 15 Jan 2015 11:11:33 -0600 Subject: [PATCH] Polish Boot documentation This removes the warnings produced by the invalid callout in the boot reference. It also provides an example of how to customize the redis connection and links to the "Connection to Redis" section of the Spring Boot reference. Issue #108 --- docs/src/docs/asciidoc/guides/boot.adoc | 18 +++++++++++++++--- .../java/sample/config/HttpSessionConfig.java | 9 ++------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/docs/src/docs/asciidoc/guides/boot.adoc b/docs/src/docs/asciidoc/guides/boot.adoc index e7e30677..486fc227 100644 --- a/docs/src/docs/asciidoc/guides/boot.adoc +++ b/docs/src/docs/asciidoc/guides/boot.adoc @@ -75,9 +75,21 @@ include::{samples-dir}boot/src/main/java/sample/config/HttpSessionConfig.java[] <1> The `@EnableRedisHttpSession` annotation creates a Spring Bean with the name of `springSessionRepositoryFilter` that implements Filter. The filter is what is in charge of replacing the `HttpSession` implementation to be backed by Spring Session. In this instance Spring Session is backed by Redis. -<2> Spring Boot automatically creates a `RedisConnectionFactory` that connects Spring Session to the Redis Server. -In our example, we are connecting to localhost on the default port (6379). In a production environment you need to ensure to configure your JedisConnectionFactory bean to point to your Redis instance. -For more information on configuring Spring Data Redis, refer to the http://docs.spring.io/spring-data/data-redis/docs/current/reference/html/[reference documentation]. + +[[boot-redis-configuration]] +== Configuring the Redis Connection + +Spring Boot automatically creates a `RedisConnectionFactory` that connects Spring Session to the Redis Server. +In a production environment you need to ensure to update your configuration to point to your Redis server. For example, you can include the following in your *application.properties* + +.src/main/resources/application.properties +---- +spring.redis.host=localhost +spring.redis.password=secret +spring.redis.port=6379 +---- + +For more information, refer to http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-connecting-to-redis[Connecting to Redis] portion of the Spring Boot documentation. == Servlet Container Initialization diff --git a/samples/boot/src/main/java/sample/config/HttpSessionConfig.java b/samples/boot/src/main/java/sample/config/HttpSessionConfig.java index 25c3b7be..0a424266 100644 --- a/samples/boot/src/main/java/sample/config/HttpSessionConfig.java +++ b/samples/boot/src/main/java/sample/config/HttpSessionConfig.java @@ -1,11 +1,6 @@ package sample.config; -import org.springframework.context.annotation.Configuration; -import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession; +import org.springframework.session.data.redis.config.annotation.web.http.*; -@Configuration @EnableRedisHttpSession // <1> -public class HttpSessionConfig { - - -} +public class HttpSessionConfig { }