Advertisement
DidiHristova93

Untitled

Dec 1st, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. package app;
  2.  
  3. import org.springframework.stereotype.Controller;
  4. import org.springframework.ui.Model;
  5. import org.springframework.web.bind.annotation.GetMapping;
  6. import org.springframework.web.bind.annotation.PathVariable;
  7. import org.springframework.web.bind.annotation.ResponseBody;
  8.  
  9. @Controller
  10. public class MainController {
  11.  
  12. @GetMapping("/softuni/{username}")
  13.  
  14. public String index(Model model, @PathVariable String username) {
  15. model.addAttribute("username", username);
  16. model.addAttribute("fullpsuvnq","ko praish");
  17. return "users";
  18. }
  19.  
  20. }
  21.  
  22.  
  23.  
  24. <!DOCTYPE html>
  25. <html lang="en" xmlns:th="http://www.thymeleaf.org">
  26.  
  27. <head>
  28. <meta charset="UTF-8/">
  29. <title>SoftUNi</title>
  30. </head>
  31. <body>
  32. <h1 th:text="'Hello ' + ${username} "></h1>
  33. <p th:text="${fullpsuvnq} + ' be?'" ></p>
  34. </body>
  35. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement