Nonverbis

Untitled

Nov 17th, 2020
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. home.html
  2.  
  3. <!DOCTYPE html>
  4. <html xmlns:th="http://www.thymeleaf.org">
  5. <head>
  6. <title>Good Thymes Virtual Grocery</title>
  7. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  8. <link rel="stylesheet" type="text/css" media="all"
  9. href="../../css/gtvg.css" th:href="@{/css/gtvg.css}" />
  10. </head>
  11. <body>
  12. <p th:text="#{home.welcome}">Welcome to our grocery store!</p>
  13. </body>
  14. </html>
  15.  
  16.  
  17.  
  18. HomeController.java
  19.  
  20. @Controller
  21. public class HomeController{
  22.  
  23. @GetMapping("/home")
  24. public String process(){
  25. return "home";
  26. }
  27. }
  28.  
  29.  
  30. home_es.properties
  31.  
  32. home.welcome=¡Bienvenido a nuestra tienda de comestibles!
  33.  
  34.  
  35.  
  36. GeneralConfig.java
  37.  
  38. @Configuration
  39. public class GeneralConfig {
  40. @Bean
  41. public ResourceBundleMessageSource messageSource() {
  42. ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource();
  43. messageSource.setBasename("home");
  44. return messageSource;
  45. }
  46. }
  47.  
Advertisement
Add Comment
Please, Sign In to add comment