Upgrade samples to Spring Boot 3.0.0-SNAPSHOT #
Closes gh-2074
This commit is contained in:
@@ -4,7 +4,7 @@ buildscript {
|
||||
snapshotBuild = version.endsWith('SNAPSHOT')
|
||||
milestoneBuild = !(releaseBuild || snapshotBuild)
|
||||
|
||||
springBootVersion = '2.5.5'
|
||||
springBootVersion = '3.0.0-SNAPSHOT'
|
||||
}
|
||||
|
||||
repositories {
|
||||
|
||||
@@ -19,11 +19,11 @@ package sample.session;
|
||||
import java.io.IOException;
|
||||
import java.net.InetAddress;
|
||||
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import jakarta.servlet.FilterChain;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.http.HttpSession;
|
||||
|
||||
import com.maxmind.geoip2.DatabaseReader;
|
||||
import com.maxmind.geoip2.model.CityResponse;
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
<tr th:each="sessionElement : ${sessions}" th:with="details=${sessionElement.getAttribute('SESSION_DETAILS')}">
|
||||
<td th:text="${sessionElement.id.substring(30)}"></td>
|
||||
<td th:text="${details?.location}"></td>
|
||||
<td th:text="${#temporals.format(sessionElement.creationTime.atZone(T(java.time.ZoneId).systemDefault()),'dd/MMM/yyyy HH:mm:ss')}"></td>
|
||||
<td th:text="${#temporals.format(sessionElement.lastAccessedTime.atZone(T(java.time.ZoneId).systemDefault()),'dd/MMM/yyyy HH:mm:ss')}"></td>
|
||||
<td th:text="${#dates.format(sessionElement.creationTime,'dd/MMM/yyyy HH:mm:ss')}"></td>
|
||||
<td th:text="${#dates.format(sessionElement.lastAccessedTime,'dd/MMM/yyyy HH:mm:ss')}"></td>
|
||||
<td th:text="${details?.accessType}"></td>
|
||||
<td>
|
||||
<form th:action="@{'/sessions/' + ${sessionElement.id}}" th:method="post">
|
||||
|
||||
@@ -2,3 +2,7 @@ logging:
|
||||
level:
|
||||
org.springframework.data.mongodb: DEBUG
|
||||
org.springframework.session: DEBUG
|
||||
spring:
|
||||
mongodb:
|
||||
embedded:
|
||||
version: 3.4.3
|
||||
|
||||
@@ -5,7 +5,7 @@ dependencies {
|
||||
implementation "org.springframework.boot:spring-boot-starter-web"
|
||||
implementation "org.springframework.boot:spring-boot-starter-thymeleaf"
|
||||
implementation "nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect"
|
||||
implementation "org.thymeleaf.extras:thymeleaf-extras-springsecurity5"
|
||||
implementation "org.thymeleaf.extras:thymeleaf-extras-springsecurity6"
|
||||
implementation "org.springframework.boot:spring-boot-starter-data-mongodb"
|
||||
implementation "org.springframework.boot:spring-boot-starter-security"
|
||||
implementation "de.flapdoodle.embed:de.flapdoodle.embed.mongo"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
spring.thymeleaf.cache=false
|
||||
spring.template.cache=false
|
||||
spring.data.mongodb.port=0
|
||||
spring.mongodb.embedded.version=3.4.3
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<html xmlns:layout="https://github.com/ultraq/thymeleaf-layout-dialect" layout:decorator="layout">
|
||||
<html xmlns:layout="https://github.com/ultraq/thymeleaf-layout-dialect" layout:decorate="layout">
|
||||
<head>
|
||||
<title>Secured Content</title>
|
||||
</head>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
xmlns:th="https://www.thymeleaf.org"
|
||||
xmlns:layout="https://github.com/ultraq/thymeleaf-layout-dialect">
|
||||
<head>
|
||||
<title layout:title-pattern="$DECORATOR_TITLE - $CONTENT_TITLE">Spring Session Sample</title>
|
||||
<title layout:title-pattern="$LAYOUT_TITLE - $CONTENT_TITLE">Spring Session Sample</title>
|
||||
<link rel="icon" type="image/x-icon" th:href="@{/resources/img/favicon.ico}" href="../static/img/favicon.ico"/>
|
||||
<link th:href="@{/webjars/bootstrap/css/bootstrap.min.css}" href="/webjars/bootstrap/css/bootstrap.min.css" rel="stylesheet"></link>
|
||||
<style type="text/css">
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package sample.web;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
@@ -18,13 +18,13 @@ package sample.data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.validation.constraints.Email;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.validation.constraints.Email;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user