Skip to content

Commit aecae9f

Browse files
committed
slight adjustment to hidden page behavior
1 parent ddefd7c commit aecae9f

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

src/main/java/hawk/controller/HiddenController.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import org.springframework.stereotype.Controller;
44
import org.springframework.ui.Model;
55
import org.springframework.web.bind.annotation.GetMapping;
6+
import org.springframework.web.bind.annotation.PathVariable;
67

78
@Controller
89
public class HiddenController {
@@ -13,9 +14,10 @@ public String index(Model model) {
1314
return "hidden";
1415
}
1516

16-
@GetMapping("/hidden/hidden2")
17-
public String jwtAuth(Model model) {
18-
model.addAttribute("title", "Rando hidden page");
17+
@GetMapping("/hidden/{id}")
18+
public String jwtAuth(Model model, @PathVariable("id") String id) {
19+
String title = "Random hidden page : " + id;
20+
model.addAttribute("title", title);
1921
return "hidden2";
2022
}
2123
}

src/main/resources/templates/hidden2.html

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
<!DOCTYPE html>
2-
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8">
5-
<title><!DOCTYPE html>
6-
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="https://www.thymeleaf.org"
7-
xmlns:sec="https://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
8-
<head>
2+
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="https://www.thymeleaf.org"
3+
xmlns:sec="https://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
4+
<head>
95
<title th:text="${title}"></title>
10-
<th:block th:replace="general.html :: head"/>
6+
<th:block th:replace="general.html :: head"/>
7+
</head>
118

129
<style>
1310
#results {

0 commit comments

Comments
 (0)