정적 컨텐츠

https://docs.spring.io/spring-boot/docs/2.3.1.RELEASE/reference/html/spring-boot-features.html#boot-features-spring-mvc-static-content

<resources/static/hello-static.html>

 <!DOCTYPE HTML>
 <html>
 <head>
    <title>static content</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
 </head>
 <body>
정적 컨텐츠 입니다.
 </body>
 </html>

image.png


MVC와 템플릿 엔진

Controller

@Controller
 public class HelloController {
    @GetMapping("hello-mvc")
 public String helloMvc(@RequestParam("name") String name, Model model) {
        model.addAttribute("name", name);
 return "hello-template";
    }
 }

View

<resources/templates/hello-template.html>

 <html xmlns:th="<http://www.thymeleaf.org>">
 <body>
 <p th:text="'hello ' + ${name}">hello! empty</p>
</body>
 </html>

image.png