From 39ff9835672cb3308b1f42e5a8e8e30caa91ee4d Mon Sep 17 00:00:00 2001 From: John Blum Date: Thu, 2 Dec 2021 23:33:57 -0800 Subject: [PATCH] Refactor all Spring Session, Apache Geode Samples using Spring Boot to switch from Thymeleaf to FreeMarker. Convert Thymelead templates to FreeMarker templates. Remove the use of WebJars. Refactor all Sample application code. --- ...ample-boot-gemfire-with-gfsh-servers.gradle | 4 +--- .../main/java/sample/client/Application.java | 1 + .../templates/{index.html => index.ftlh} | 18 +++++++++++------- ...ple-boot-gemfire-with-scoped-proxies.gradle | 4 +--- .../main/java/sample/client/Application.java | 9 ++++----- .../templates/{index.html => index.ftlh} | 14 ++++++++------ .../spring-session-sample-boot-gemfire.gradle | 4 +--- .../java/sample/AttributeTests.java | 1 - .../java/sample/pages/HomePage.java | 1 - .../main/java/sample/client/Application.java | 14 +++++++------- .../templates/{index.html => index.ftlh} | 18 +++++++++++------- 11 files changed, 45 insertions(+), 43 deletions(-) rename samples/boot/gemfire-with-gfsh-servers/src/main/resources/templates/{index.html => index.ftlh} (67%) rename samples/boot/gemfire-with-scoped-proxies/src/main/resources/templates/{index.html => index.ftlh} (64%) rename samples/boot/gemfire/src/main/resources/templates/{index.html => index.ftlh} (67%) diff --git a/samples/boot/gemfire-with-gfsh-servers/spring-session-sample-boot-gemfire-with-gfsh-servers.gradle b/samples/boot/gemfire-with-gfsh-servers/spring-session-sample-boot-gemfire-with-gfsh-servers.gradle index 83d7f15..f72bb91 100644 --- a/samples/boot/gemfire-with-gfsh-servers/spring-session-sample-boot-gemfire-with-gfsh-servers.gradle +++ b/samples/boot/gemfire-with-gfsh-servers/spring-session-sample-boot-gemfire-with-gfsh-servers.gradle @@ -6,7 +6,7 @@ dependencies { implementation project(':spring-session-data-geode') - implementation("org.springframework.boot:spring-boot-starter-thymeleaf") { + implementation("org.springframework.boot:spring-boot-starter-freemarker") { exclude group: "org.apache.logging.log4j", module: "log4j-to-slf4j" } @@ -16,8 +16,6 @@ dependencies { implementation "jakarta.servlet:jakarta.servlet-api" implementation "org.springframework.data:spring-data-geode-test" - implementation "org.webjars:bootstrap" - implementation "org.webjars:webjars-locator" runtimeOnly "org.springframework.shell:spring-shell" diff --git a/samples/boot/gemfire-with-gfsh-servers/src/main/java/sample/client/Application.java b/samples/boot/gemfire-with-gfsh-servers/src/main/java/sample/client/Application.java index 8c5e788..e0b4061 100644 --- a/samples/boot/gemfire-with-gfsh-servers/src/main/java/sample/client/Application.java +++ b/samples/boot/gemfire-with-gfsh-servers/src/main/java/sample/client/Application.java @@ -102,6 +102,7 @@ public class Application { // end::class[] + @SuppressWarnings("all") HttpSession updateRequestCount(HttpSession session) { synchronized (session) { diff --git a/samples/boot/gemfire-with-gfsh-servers/src/main/resources/templates/index.html b/samples/boot/gemfire-with-gfsh-servers/src/main/resources/templates/index.ftlh similarity index 67% rename from samples/boot/gemfire-with-gfsh-servers/src/main/resources/templates/index.html rename to samples/boot/gemfire-with-gfsh-servers/src/main/resources/templates/index.ftlh index 48eab31..5cfe004 100644 --- a/samples/boot/gemfire-with-gfsh-servers/src/main/resources/templates/index.html +++ b/samples/boot/gemfire-with-gfsh-servers/src/main/resources/templates/index.ftlh @@ -1,5 +1,4 @@ - - + Session Attributes