Add Sample Code for HTTP Session Caching.

This commit is contained in:
John Blum
2019-08-19 12:57:18 -07:00
parent 112332049e
commit 24694d01fa
5 changed files with 200 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
# Spring Boot application.properties for the HTTP Session State Caching Example application.
spring.application.name=HttpSessionCachingApplication
spring.data.gemfire.cache.log-level=error
spring.session.data.gemfire.cache.client.pool.name=DEFAULT
spring.session.data.gemfire.cache.client.region.shortcut=LOCAL
spring.session.data.gemfire.session.region.name=Sessions
server.servlet.session.timeout=15

View File

@@ -0,0 +1,31 @@
<!DOCTYPE html SYSTEM "https://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-3.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="https://www.thymeleaf.org">
<head>
<title>HTTP Session Details</title>
<link rel="stylesheet" th:href="@{/webjars/bootstrap/css/bootstrap.min.css}" href="/webjars/bootstrap/css/bootstrap.min.css"/>
<style type="text/css">
body {
padding: 1em;
}
</style>
</head>
<body>
<div class="container">
<table class="table table-striped" border="1">
<thead align="left">
<tr>
<th>HttpSession Type</th>
<th>HttpSession Count</th>
<th>HttpServletRequest Count</th>
</tr>
</thead>
<tbody>
<tr>
<td th:text="${sessionType}">value</td>
<td th:text="${sessionCount}">value</td>
<td th:text="${requestCount}">value</td>
</tr>
</tbody>
</table>
</div>
</body>