Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package app;
- import org.springframework.stereotype.Controller;
- import org.springframework.ui.Model;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.PathVariable;
- import org.springframework.web.bind.annotation.ResponseBody;
- @Controller
- public class MainController {
- @GetMapping("/softuni/{username}")
- public String index(Model model, @PathVariable String username) {
- model.addAttribute("username", username);
- model.addAttribute("fullpsuvnq","ko praish");
- return "users";
- }
- }
- <!DOCTYPE html>
- <html lang="en" xmlns:th="http://www.thymeleaf.org">
- <head>
- <meta charset="UTF-8/">
- <title>SoftUNi</title>
- </head>
- <body>
- <h1 th:text="'Hello ' + ${username} "></h1>
- <p th:text="${fullpsuvnq} + ' be?'" ></p>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment