Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions spring-thymeleaf-2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@

- [Working with Enums in Thymeleaf](https://www.baeldung.com/thymeleaf-enums)
- [Changing the Thymeleaf Template Directory in Spring Boot](https://www.baeldung.com/spring-thymeleaf-template-directory)
- [Spring Request Parameters with Thymeleaf](https://www.baeldung.com/spring-thymeleaf-request-parameters)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.demo;
package com.baeldung.thymeleaf.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
Expand All @@ -12,7 +12,7 @@
@Controller
public class ParticipantController {

@RequestMapping("/")
@RequestMapping("/participants")
public String index(
@RequestParam(value = "participant", required = false) String participant,
@RequestParam(value = "country", required = false) String country,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</head>

<h2>Enter participant</h2>
<form th:action="@{/}">
<form th:action="@{/participants}">

<input type="text" th:name="participant"/>
<select name="country">
Expand All @@ -25,7 +25,7 @@ <h2 >User Details</h2>
<h2>Users</h2>
<th:block th:each="userId: ${userIds}">
<p>
<a th:href="@{/(id=${userId})}"> User [[${userId}]]</a>
<a th:href="@{/participants(id=${userId})}"> User [[${userId}]]</a>
</p>
</th:block>

Expand Down