BAEL-3012 Spring Request Parameters with Thymeleaf - move to new module
This commit is contained in:
parent
8470319d13
commit
db1b7f1f14
|
@ -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)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package com.example.demo;
|
||||
package com.baeldung.thymeleaf.controller;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
|
@ -12,7 +12,7 @@ import static java.util.Arrays.asList;
|
|||
@Controller
|
||||
public class ParticipantController {
|
||||
|
||||
@RequestMapping("/")
|
||||
@RequestMapping("/participants")
|
||||
public String index(
|
||||
@RequestParam(value = "participant", required = false) String participant,
|
||||
@RequestParam(value = "country", required = false) String country,
|
|
@ -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">
|
||||
|
@ -25,7 +25,7 @@
|
|||
<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>
|
||||
|
Loading…
Reference in New Issue