Merge pull request #7612 from Maiklins/BAEL-3012-move-thymeleaf-parameters-to-new-module

BAEL 3012 move thymeleaf parameters to new module
This commit is contained in:
Loredana Crusoveanu 2019-08-19 23:49:28 +03:00 committed by GitHub
commit 5985675737
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

View File

@ -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)

View File

@ -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,

View File

@ -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>