0

thymeleaf -> freemarker

This commit is contained in:
2022-04-17 17:29:15 +03:00
parent d1d3e5df18
commit fb86fa2e8a
14 changed files with 33 additions and 45 deletions

View File

@@ -14,7 +14,7 @@ repositories {
dependencies { dependencies {
implementation('org.springframework.boot:spring-boot-starter-web') implementation('org.springframework.boot:spring-boot-starter-web')
implementation('org.springframework.boot:spring-boot-starter-thymeleaf') implementation('org.springframework.boot:spring-boot-starter-freemarker')
implementation('org.springframework.boot:spring-boot-starter-security') implementation('org.springframework.boot:spring-boot-starter-security')
implementation('org.springframework.security:spring-security-oauth2-client') implementation('org.springframework.security:spring-security-oauth2-client')

View File

@@ -5,6 +5,9 @@ server:
debug: false debug: false
spring: spring:
freemarker:
template-loader-path: classpath:/templates
suffix: .ftlh
security: security:
oauth2: oauth2:
client: client:

View File

@@ -0,0 +1,2 @@
</body>
</html>

View File

@@ -7,6 +7,3 @@
<body> <body>
<h1>Discord OAuth2 Example</h1> <h1>Discord OAuth2 Example</h1>
<hr> <hr>
<p style="color: red">[TOP SECRET PAGE]</p>
</body>
</html>

View File

@@ -0,0 +1,7 @@
<#include "includes/header.ftlh">
<p>
Home public page<br>
---&gt; <a href="/secret">Secret Page</a> &lt;---<br>
[ <a href="/oauth2/authorization/discord">Login Discord</a> ]
</p>
<#include "includes/foother.ftlh">

View File

@@ -1,18 +0,0 @@
<!DOCTYPE html>
<html lang="ru"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="https://www.thymeleaf.org">
<head>
<title>Discord OAuth2 Example</title>
<link rel="icon" href="data:;base64,=">
</head>
<body>
<h1>Discord OAuth2 Example</h1>
<hr>
<p>
Home public page<br>
---&gt; <a th:href="@{/secret}">Secret Page</a> &lt;---<br>
[ <a th:href="@{/oauth2/authorization/discord}">Login Discord</a> ]
</p>
</body>
</html>

View File

@@ -0,0 +1,3 @@
<#include "includes/header.ftlh">
<p style="color: red">[TOP SECRET PAGE]</p>
<#include "includes/foother.ftlh">

View File

@@ -14,7 +14,7 @@ repositories {
dependencies { dependencies {
implementation('org.springframework.boot:spring-boot-starter-web') implementation('org.springframework.boot:spring-boot-starter-web')
implementation('org.springframework.boot:spring-boot-starter-thymeleaf') implementation('org.springframework.boot:spring-boot-starter-freemarker')
implementation('org.springframework.boot:spring-boot-starter-security') implementation('org.springframework.boot:spring-boot-starter-security')
implementation('org.springframework.security:spring-security-oauth2-client') implementation('org.springframework.security:spring-security-oauth2-client')

View File

@@ -5,6 +5,9 @@ server:
debug: false debug: false
spring: spring:
freemarker:
template-loader-path: classpath:/templates
suffix: .ftlh
security: security:
oauth2: oauth2:
client: client:

View File

@@ -0,0 +1,2 @@
</body>
</html>

View File

@@ -7,6 +7,3 @@
<body> <body>
<h1>GitHub OAuth2 Example</h1> <h1>GitHub OAuth2 Example</h1>
<hr> <hr>
<p style="color: red">[TOP SECRET PAGE]</p>
</body>
</html>

View File

@@ -0,0 +1,7 @@
<#include "includes/header.ftlh">
<p>
Home public page<br>
---&gt; <a href="/secret">Secret Page</a> &lt;---<br>
[ <a href="/oauth2/authorization/github">Login GitHub</a> ]
</p>
<#include "includes/foother.ftlh">

View File

@@ -1,18 +0,0 @@
<!DOCTYPE html>
<html lang="ru"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="https://www.thymeleaf.org">
<head>
<title>GitHub OAuth2 Example</title>
<link rel="icon" href="data:;base64,=">
</head>
<body>
<h1>GitHub OAuth2 Example</h1>
<hr>
<p>
Home public page<br>
---&gt; <a th:href="@{/secret}">Secret Page</a> &lt;---<br>
[ <a th:href="@{/oauth2/authorization/github}">Login GitHub</a> ]
</p>
</body>
</html>

View File

@@ -0,0 +1,3 @@
<#include "includes/header.ftlh">
<p style="color: red">[TOP SECRET PAGE]</p>
<#include "includes/foother.ftlh">