From db1b7f1f1415ca90ed62457a92eac987c4f48a4d Mon Sep 17 00:00:00 2001 From: mikr Date: Sun, 18 Aug 2019 22:46:19 +0200 Subject: [PATCH] BAEL-3012 Spring Request Parameters with Thymeleaf - move to new module --- spring-thymeleaf-2/README.md | 1 + .../baeldung/thymeleaf/controller/ParticipantController.java | 4 ++-- .../src/main/resources/templates-2}/participants.html | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) rename {spring-thymeleaf => spring-thymeleaf-2}/src/main/java/com/baeldung/thymeleaf/controller/ParticipantController.java (91%) rename {spring-thymeleaf/src/main/resources/templates => spring-thymeleaf-2/src/main/resources/templates-2}/participants.html (86%) diff --git a/spring-thymeleaf-2/README.md b/spring-thymeleaf-2/README.md index 9e12f2d99f..ce83032cb5 100644 --- a/spring-thymeleaf-2/README.md +++ b/spring-thymeleaf-2/README.md @@ -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) diff --git a/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/ParticipantController.java b/spring-thymeleaf-2/src/main/java/com/baeldung/thymeleaf/controller/ParticipantController.java similarity index 91% rename from spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/ParticipantController.java rename to spring-thymeleaf-2/src/main/java/com/baeldung/thymeleaf/controller/ParticipantController.java index eebe37e000..9a354e709c 100644 --- a/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/ParticipantController.java +++ b/spring-thymeleaf-2/src/main/java/com/baeldung/thymeleaf/controller/ParticipantController.java @@ -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, diff --git a/spring-thymeleaf/src/main/resources/templates/participants.html b/spring-thymeleaf-2/src/main/resources/templates-2/participants.html similarity index 86% rename from spring-thymeleaf/src/main/resources/templates/participants.html rename to spring-thymeleaf-2/src/main/resources/templates-2/participants.html index 8d4e552093..f7e017e777 100644 --- a/spring-thymeleaf/src/main/resources/templates/participants.html +++ b/spring-thymeleaf-2/src/main/resources/templates-2/participants.html @@ -4,7 +4,7 @@

Enter participant

-
+