From: Kai Moritz Date: Fri, 8 Jan 2021 15:49:23 +0000 (+0100) Subject: TODO?: DemoController X-Git-Tag: wip X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=ab2e8715122c719afa1d6972fb1beaf6dc5a3939;p=demos%2Fhttpresources TODO?: DemoController --- diff --git a/pom.xml b/pom.xml index 3cd520c..64227c7 100644 --- a/pom.xml +++ b/pom.xml @@ -23,6 +23,10 @@ org.springframework.boot spring-boot-starter-web + + org.springframework.boot + spring-boot-starter-thymeleaf + de.juplo http-resources diff --git a/src/main/java/de/juplo/demo/httpresources/DemoController.java b/src/main/java/de/juplo/demo/httpresources/DemoController.java new file mode 100644 index 0000000..96020ff --- /dev/null +++ b/src/main/java/de/juplo/demo/httpresources/DemoController.java @@ -0,0 +1,20 @@ +package de.juplo.demo.httpresources; + +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; + + +@Controller +public class DemoController +{ + @RequestMapping("/controller.html") + public String controller( + @RequestParam(defaultValue = "index") String template, + Model model) + { + model.addAttribute("template", template); + return template; + } +}