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
This commit is contained in:
Rob Winch
2015-01-15 11:11:33 -06:00
parent 37aafc5148
commit 3f23643121
2 changed files with 17 additions and 10 deletions

View File

@@ -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. <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. 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. 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. [[boot-redis-configuration]]
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]. == 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 == Servlet Container Initialization

View File

@@ -1,11 +1,6 @@
package sample.config; package sample.config;
import org.springframework.context.annotation.Configuration; import org.springframework.session.data.redis.config.annotation.web.http.*;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
@Configuration
@EnableRedisHttpSession // <1> @EnableRedisHttpSession // <1>
public class HttpSessionConfig { public class HttpSessionConfig { }
}