From 782167b306b4296e7275a01497f0de359eb05c14 Mon Sep 17 00:00:00 2001 From: Vedran Pavic Date: Thu, 13 Jun 2019 22:09:55 +0200 Subject: [PATCH] Add SimpleRedisOperationsSessionRepository sample Resolves: #1408 --- .../src/docs/asciidoc/index.adoc | 4 + ...ng-session-sample-boot-redis-simple.gradle | 21 +++ .../java/sample/BootTests.java | 103 ++++++++++++++ .../java/sample/pages/BasePage.java | 38 ++++++ .../java/sample/pages/HomePage.java | 62 +++++++++ .../java/sample/pages/LoginPage.java | 65 +++++++++ .../resources/testcontainers.properties | 1 + .../src/main/java/sample/Application.java | 29 ++++ .../java/sample/config/SecurityConfig.java | 40 ++++++ .../java/sample/config/SessionConfig.java | 52 +++++++ .../main/java/sample/config/WebMvcConfig.java | 31 +++++ .../src/main/resources/application.properties | 1 + .../src/main/resources/static/favicon.ico | Bin 0 -> 1150 bytes .../src/main/resources/static/images/logo.png | Bin 0 -> 1123 bytes .../src/main/resources/templates/index.html | 11 ++ .../src/main/resources/templates/layout.html | 128 ++++++++++++++++++ 16 files changed, 586 insertions(+) create mode 100644 spring-session-samples/spring-session-sample-boot-redis-simple/spring-session-sample-boot-redis-simple.gradle create mode 100644 spring-session-samples/spring-session-sample-boot-redis-simple/src/integration-test/java/sample/BootTests.java create mode 100644 spring-session-samples/spring-session-sample-boot-redis-simple/src/integration-test/java/sample/pages/BasePage.java create mode 100644 spring-session-samples/spring-session-sample-boot-redis-simple/src/integration-test/java/sample/pages/HomePage.java create mode 100644 spring-session-samples/spring-session-sample-boot-redis-simple/src/integration-test/java/sample/pages/LoginPage.java create mode 100644 spring-session-samples/spring-session-sample-boot-redis-simple/src/integration-test/resources/testcontainers.properties create mode 100644 spring-session-samples/spring-session-sample-boot-redis-simple/src/main/java/sample/Application.java create mode 100644 spring-session-samples/spring-session-sample-boot-redis-simple/src/main/java/sample/config/SecurityConfig.java create mode 100644 spring-session-samples/spring-session-sample-boot-redis-simple/src/main/java/sample/config/SessionConfig.java create mode 100644 spring-session-samples/spring-session-sample-boot-redis-simple/src/main/java/sample/config/WebMvcConfig.java create mode 100644 spring-session-samples/spring-session-sample-boot-redis-simple/src/main/resources/application.properties create mode 100644 spring-session-samples/spring-session-sample-boot-redis-simple/src/main/resources/static/favicon.ico create mode 100644 spring-session-samples/spring-session-sample-boot-redis-simple/src/main/resources/static/images/logo.png create mode 100644 spring-session-samples/spring-session-sample-boot-redis-simple/src/main/resources/templates/index.html create mode 100644 spring-session-samples/spring-session-sample-boot-redis-simple/src/main/resources/templates/layout.html diff --git a/spring-session-docs/src/docs/asciidoc/index.adoc b/spring-session-docs/src/docs/asciidoc/index.adoc index 59d472fa..7b2658fa 100644 --- a/spring-session-docs/src/docs/asciidoc/index.adoc +++ b/spring-session-docs/src/docs/asciidoc/index.adoc @@ -74,6 +74,10 @@ To get started with Spring Session, the best place to start is our Sample Applic | Demonstrates how to use Spring Session to replace the `HttpSession` with Redis using JSON serialization. | +| {gh-samples-url}spring-session-sample-boot-redis-simple[HttpSession with simple Redis `SessionRepository`] +| Demonstrates how to use Spring Session to replace the `HttpSession` with Redis using `SimpleRedisOperationsSessionRepository`. +| + |=== .Sample Applications that use Spring Java-based configuration diff --git a/spring-session-samples/spring-session-sample-boot-redis-simple/spring-session-sample-boot-redis-simple.gradle b/spring-session-samples/spring-session-sample-boot-redis-simple/spring-session-sample-boot-redis-simple.gradle new file mode 100644 index 00000000..dafb79e4 --- /dev/null +++ b/spring-session-samples/spring-session-sample-boot-redis-simple/spring-session-sample-boot-redis-simple.gradle @@ -0,0 +1,21 @@ +apply plugin: 'io.spring.convention.spring-sample-boot' + +dependencies { + compile project(':spring-session-data-redis') + compile 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect' + compile 'org.springframework.boot:spring-boot-starter-data-redis' + compile 'org.springframework.boot:spring-boot-starter-security' + compile 'org.springframework.boot:spring-boot-starter-thymeleaf' + compile 'org.springframework.boot:spring-boot-starter-web' + compile 'org.springframework.boot:spring-boot-devtools' + compile 'org.webjars:bootstrap' + compile 'org.webjars:html5shiv' + compile 'org.webjars:webjars-locator-core' + + testCompile 'org.junit.jupiter:junit-jupiter-api' + testRuntime 'org.junit.jupiter:junit-jupiter-engine' + testCompile 'org.springframework.boot:spring-boot-starter-test' + + integrationTestCompile seleniumDependencies + integrationTestCompile 'org.testcontainers:testcontainers' +} diff --git a/spring-session-samples/spring-session-sample-boot-redis-simple/src/integration-test/java/sample/BootTests.java b/spring-session-samples/spring-session-sample-boot-redis-simple/src/integration-test/java/sample/BootTests.java new file mode 100644 index 00000000..b52edceb --- /dev/null +++ b/spring-session-samples/spring-session-sample-boot-redis-simple/src/integration-test/java/sample/BootTests.java @@ -0,0 +1,103 @@ +/* + * Copyright 2014-2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package sample; + +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.openqa.selenium.WebDriver; +import org.testcontainers.containers.GenericContainer; +import sample.pages.HomePage; +import sample.pages.LoginPage; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; +import org.springframework.boot.test.context.TestConfiguration; +import org.springframework.context.annotation.Bean; +import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; +import org.springframework.test.context.junit.jupiter.SpringExtension; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.htmlunit.webdriver.MockMvcHtmlUnitDriverBuilder; + +@ExtendWith(SpringExtension.class) +@AutoConfigureMockMvc +@SpringBootTest(webEnvironment = WebEnvironment.MOCK) +class BootTests { + + private static final String DOCKER_IMAGE = "redis:5.0.5"; + + @Autowired + private MockMvc mockMvc; + + private WebDriver driver; + + @BeforeEach + void setup() { + this.driver = MockMvcHtmlUnitDriverBuilder.mockMvcSetup(this.mockMvc).build(); + } + + @AfterEach + void tearDown() { + this.driver.quit(); + } + + @Test + void home() { + LoginPage login = HomePage.go(this.driver); + login.assertAt(); + } + + @Test + void login() { + LoginPage login = HomePage.go(this.driver); + HomePage home = login.form().login(HomePage.class); + home.assertAt(); + home.containCookie("SESSION"); + home.doesNotContainCookie("JSESSIONID"); + } + + @Test + void logout() { + LoginPage login = HomePage.go(this.driver); + HomePage home = login.form().login(HomePage.class); + home.logout(); + login.assertAt(); + } + + @TestConfiguration + static class Config { + + @Bean + public GenericContainer redisContainer() { + GenericContainer redisContainer = new GenericContainer(DOCKER_IMAGE) + .withExposedPorts(6379); + redisContainer.start(); + return redisContainer; + } + + @Bean + public LettuceConnectionFactory redisConnectionFactory() { + return new LettuceConnectionFactory(redisContainer().getContainerIpAddress(), + redisContainer().getFirstMappedPort()); + } + + } + +} diff --git a/spring-session-samples/spring-session-sample-boot-redis-simple/src/integration-test/java/sample/pages/BasePage.java b/spring-session-samples/spring-session-sample-boot-redis-simple/src/integration-test/java/sample/pages/BasePage.java new file mode 100644 index 00000000..9159c078 --- /dev/null +++ b/spring-session-samples/spring-session-sample-boot-redis-simple/src/integration-test/java/sample/pages/BasePage.java @@ -0,0 +1,38 @@ +/* + * Copyright 2014-2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package sample.pages; + +import org.openqa.selenium.WebDriver; + +public class BasePage { + + private WebDriver driver; + + public BasePage(WebDriver driver) { + this.driver = driver; + } + + public WebDriver getDriver() { + return this.driver; + } + + public static void get(WebDriver driver, String get) { + String baseUrl = "http://localhost"; + driver.get(baseUrl + get); + } + +} diff --git a/spring-session-samples/spring-session-sample-boot-redis-simple/src/integration-test/java/sample/pages/HomePage.java b/spring-session-samples/spring-session-sample-boot-redis-simple/src/integration-test/java/sample/pages/HomePage.java new file mode 100644 index 00000000..2e0c28e0 --- /dev/null +++ b/spring-session-samples/spring-session-sample-boot-redis-simple/src/integration-test/java/sample/pages/HomePage.java @@ -0,0 +1,62 @@ +/* + * Copyright 2014-2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package sample.pages; + +import java.util.Set; + +import org.openqa.selenium.By; +import org.openqa.selenium.Cookie; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.PageFactory; + +import static org.assertj.core.api.Assertions.assertThat; + +public class HomePage extends BasePage { + + public HomePage(WebDriver driver) { + super(driver); + } + + public static LoginPage go(WebDriver driver) { + get(driver, "/"); + return PageFactory.initElements(driver, LoginPage.class); + } + + public void assertAt() { + assertThat(getDriver().getTitle()) + .isEqualTo("Spring Session Sample - Secured Content"); + } + + public void containCookie(String cookieName) { + Set cookies = getDriver().manage().getCookies(); + assertThat(cookies).extracting("name").contains(cookieName); + } + + public void doesNotContainCookie(String cookieName) { + Set cookies = getDriver().manage().getCookies(); + assertThat(cookies).extracting("name").doesNotContain(cookieName); + } + + public HomePage logout() { + WebElement logout = getDriver() + .findElement(By.cssSelector("input[type=\"submit\"]")); + logout.click(); + return PageFactory.initElements(getDriver(), HomePage.class); + } + +} diff --git a/spring-session-samples/spring-session-sample-boot-redis-simple/src/integration-test/java/sample/pages/LoginPage.java b/spring-session-samples/spring-session-sample-boot-redis-simple/src/integration-test/java/sample/pages/LoginPage.java new file mode 100644 index 00000000..99fd0fae --- /dev/null +++ b/spring-session-samples/spring-session-sample-boot-redis-simple/src/integration-test/java/sample/pages/LoginPage.java @@ -0,0 +1,65 @@ +/* + * Copyright 2014-2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package sample.pages; + +import org.openqa.selenium.SearchContext; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; +import org.openqa.selenium.support.PageFactory; +import org.openqa.selenium.support.pagefactory.DefaultElementLocatorFactory; + +import static org.assertj.core.api.Assertions.assertThat; + +public class LoginPage extends BasePage { + + public LoginPage(WebDriver driver) { + super(driver); + } + + public void assertAt() { + assertThat(getDriver().getTitle()).isEqualTo("Please sign in"); + } + + public Form form() { + return new Form(getDriver()); + } + + public class Form { + + @FindBy(name = "username") + private WebElement username; + + @FindBy(name = "password") + private WebElement password; + + @FindBy(tagName = "button") + private WebElement button; + + public Form(SearchContext context) { + PageFactory.initElements(new DefaultElementLocatorFactory(context), this); + } + + public T login(Class page) { + this.username.sendKeys("user"); + this.password.sendKeys("password"); + this.button.click(); + return PageFactory.initElements(getDriver(), page); + } + } + +} diff --git a/spring-session-samples/spring-session-sample-boot-redis-simple/src/integration-test/resources/testcontainers.properties b/spring-session-samples/spring-session-sample-boot-redis-simple/src/integration-test/resources/testcontainers.properties new file mode 100644 index 00000000..e3e83419 --- /dev/null +++ b/spring-session-samples/spring-session-sample-boot-redis-simple/src/integration-test/resources/testcontainers.properties @@ -0,0 +1 @@ +ryuk.container.timeout=120 diff --git a/spring-session-samples/spring-session-sample-boot-redis-simple/src/main/java/sample/Application.java b/spring-session-samples/spring-session-sample-boot-redis-simple/src/main/java/sample/Application.java new file mode 100644 index 00000000..e9c3db94 --- /dev/null +++ b/spring-session-samples/spring-session-sample-boot-redis-simple/src/main/java/sample/Application.java @@ -0,0 +1,29 @@ +/* + * Copyright 2014-2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package sample; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class Application { + + public static void main(String[] args) { + SpringApplication.run(Application.class, args); + } + +} diff --git a/spring-session-samples/spring-session-sample-boot-redis-simple/src/main/java/sample/config/SecurityConfig.java b/spring-session-samples/spring-session-sample-boot-redis-simple/src/main/java/sample/config/SecurityConfig.java new file mode 100644 index 00000000..3d6b979e --- /dev/null +++ b/spring-session-samples/spring-session-sample-boot-redis-simple/src/main/java/sample/config/SecurityConfig.java @@ -0,0 +1,40 @@ +/* + * Copyright 2014-2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package sample.config; + +import org.springframework.boot.autoconfigure.security.servlet.PathRequest; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; + +@Configuration +public class SecurityConfig extends WebSecurityConfigurerAdapter { + + // @formatter:off + @Override + protected void configure(HttpSecurity http) throws Exception { + http + .authorizeRequests() + .requestMatchers(PathRequest.toStaticResources().atCommonLocations()).permitAll() + .anyRequest().authenticated() + .and() + .formLogin() + .permitAll(); + } + // @formatter:on + +} diff --git a/spring-session-samples/spring-session-sample-boot-redis-simple/src/main/java/sample/config/SessionConfig.java b/spring-session-samples/spring-session-sample-boot-redis-simple/src/main/java/sample/config/SessionConfig.java new file mode 100644 index 00000000..c06f9558 --- /dev/null +++ b/spring-session-samples/spring-session-sample-boot-redis-simple/src/main/java/sample/config/SessionConfig.java @@ -0,0 +1,52 @@ +/* + * Copyright 2014-2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package sample.config; + +import org.springframework.beans.factory.ObjectProvider; +import org.springframework.context.annotation.Bean; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.core.RedisOperations; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.serializer.StringRedisSerializer; +import org.springframework.session.config.annotation.web.http.EnableSpringHttpSession; +import org.springframework.session.data.redis.SimpleRedisOperationsSessionRepository; + +@EnableSpringHttpSession +public class SessionConfig { + + private final RedisConnectionFactory redisConnectionFactory; + + public SessionConfig(ObjectProvider redisConnectionFactory) { + this.redisConnectionFactory = redisConnectionFactory.getIfAvailable(); + } + + @Bean + public RedisOperations sessionRedisOperations() { + RedisTemplate redisTemplate = new RedisTemplate<>(); + redisTemplate.setConnectionFactory(this.redisConnectionFactory); + redisTemplate.setKeySerializer(new StringRedisSerializer()); + redisTemplate.setHashKeySerializer(new StringRedisSerializer()); + return redisTemplate; + } + + @Bean + public SimpleRedisOperationsSessionRepository sessionRepository( + RedisOperations sessionRedisOperations) { + return new SimpleRedisOperationsSessionRepository(sessionRedisOperations); + } + +} diff --git a/spring-session-samples/spring-session-sample-boot-redis-simple/src/main/java/sample/config/WebMvcConfig.java b/spring-session-samples/spring-session-sample-boot-redis-simple/src/main/java/sample/config/WebMvcConfig.java new file mode 100644 index 00000000..1c1a2925 --- /dev/null +++ b/spring-session-samples/spring-session-sample-boot-redis-simple/src/main/java/sample/config/WebMvcConfig.java @@ -0,0 +1,31 @@ +/* + * Copyright 2014-2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package sample.config; + +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +@Configuration +public class WebMvcConfig implements WebMvcConfigurer { + + @Override + public void addViewControllers(ViewControllerRegistry registry) { + registry.addViewController("/").setViewName("index"); + } + +} diff --git a/spring-session-samples/spring-session-sample-boot-redis-simple/src/main/resources/application.properties b/spring-session-samples/spring-session-sample-boot-redis-simple/src/main/resources/application.properties new file mode 100644 index 00000000..1b5271b5 --- /dev/null +++ b/spring-session-samples/spring-session-sample-boot-redis-simple/src/main/resources/application.properties @@ -0,0 +1 @@ +spring.security.user.password=password diff --git a/spring-session-samples/spring-session-sample-boot-redis-simple/src/main/resources/static/favicon.ico b/spring-session-samples/spring-session-sample-boot-redis-simple/src/main/resources/static/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..bfb9974019d4b8b978cf34ea67f0c6804f9b76c6 GIT binary patch literal 1150 zcmZQzU<5(|0R|wcz>vYhz#zuJz@P!dKp~(AL>x#lFaYI*xFHzK2NLHVUHb1iG2*{Y zgB?lOds5VYkY4wx3IDZQ-O0jkQ{(?@bp=p{C&v8O!h&CXe)}H=o_u_bRSig==8O!i zc=x^YFzx?WUq6CX4M?xX{1U9V`}7vL{^Em6v8n;-RbSqS702#f2-g1(NLsD$!KwzN zS8ZJ%R&20o^8Y{o{{6r8@eNjaxV~+({;Q#3&F!=Q_uf49|L5O7|6hFn@<03RE(|p= zJ*s<_{YS^WcP_&H4q|}(5Orn`hB}ZwmBSk_@QDwvQS^g2lONu|PzTm~V&{JqG(7$3 zJq-P6H_u_H1L;#fa{vQto;~z`$*ZUT-~ayo|MAc7|C=7&#!v&-2UM#}0rtFhmTdiw fS5E!E^7Zq7x2tDJHpBVK>Hp`xeEbh92gs!XBi)`m literal 0 HcmV?d00001 diff --git a/spring-session-samples/spring-session-sample-boot-redis-simple/src/main/resources/static/images/logo.png b/spring-session-samples/spring-session-sample-boot-redis-simple/src/main/resources/static/images/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..393230883fb4e04829339f7c21b6ab6de7393891 GIT binary patch literal 1123 zcmV-p1f2VcP)P000yS1^@s74{)X{0000PbVXQnQ*UN; zcVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBU$1xZ9fRCwBAJakr>0R&#%?*!8<7oReN z=>H6CRSb*_9RHalf3;=rzRt=3!VW|AET)fs_IS z5aXsJDqv;5UUXCgspCNG%qCu4_4m8Q8J4{_Ss=DB)G%-}OK$)A_qiv-M@As~;az|L zf?EIsP`7cheE7}?GEN=HaRK6^jLh%PvWj*xv3z@3xac)oRV-9P3=lIhyklZuIsRdC zEQk#P>`Ve}KmUCIvzcu9Tf*+YVP*hfGu{$8D7y_HfEf3kMztIrynEOQW2*Ct&A;*G zO}I7VlHICc5w;GSdsSFH1nBbCHtgWCZ;JNm@ z`XjO?7RGP?S?;`M26}|$>d$}7+Q^c380tVF%ErLJjAqwYZkA^sS%0xHF}~wxlbiD5 z`(qoR=no*41>&DbDvtqiaJE+C3lIk&fG}bK9l%ly6jZSM`Nu#MU}XG#RzRlJh~>*q zMz|m_S~GwYKiDe_40nN83W%$i`8HWIa~)&&`WqMkpMdet@v+_G7x%2~|M)9$Tk#!Y zFw1)&gOROi`~TlS|Ne#uGBU8e{?G6W7-39r7#RMspu`I>^-8__`jg@PS4KGI{tDI)dzZ%dlS>M59FF!%vUTz)~b4X4$^~`TvW7 ziIMs5zyE)kk;ES}`AIdM1t$C=P~wMS3!!9Ap!k0ap%i9haWBalIY!4O?f(oAd%r+4 zo)k2;d7%b_#Jhnp-2~zQ1Q@}XCIrw@0t|34GX2=V#dp;1>j!5(mhZn98K?y0fw-87 z<#h&!;7V3zwkKdg)?fU+ET4a(DSgvn03;_eFu%5AV7&(n_piW02N=Hpff?mLFf{&g z0%=ZYR2CvOD9l@{`Ma!o3LDu1eZb}An>(a<~Q?=8{fF=xc@W!MoZ)b z{O|{gu_$Ev|5TXe{Z}Tay7jj||2@OO@D(hD)hsRsjrwm4H=1C4P6p+J-x==O;Vpp} zelf7T{l>^3$L4GI;MZmjLQek2%+jdD-YkChTV1vRXZ6WjKj)c!`-fi-2P5B87D!gv za)A+O=YLR%j|aSGxW@31vGu^;|BMVrzfaux>)%&1LJk9(o(#_DK=28Oy@5ho@oC^@ z5m@o{&xh3zgTK{rGV>dM|NF@cm+`=a;1wp + + Secured Content + + +
+

Secured Page

+

This page is secured using Spring Boot, Spring Session, and Spring Security.

+
+ + diff --git a/spring-session-samples/spring-session-sample-boot-redis-simple/src/main/resources/templates/layout.html b/spring-session-samples/spring-session-sample-boot-redis-simple/src/main/resources/templates/layout.html new file mode 100644 index 00000000..6c4dbdc6 --- /dev/null +++ b/spring-session-samples/spring-session-sample-boot-redis-simple/src/main/resources/templates/layout.html @@ -0,0 +1,128 @@ + + + + Spring Session Sample + + + + + + + + + + + +
+ + +
+
+ Some Success message +
+
+ Fake content +
+
+ +
+
+ + + +