응답 - 정적 리소스, 뷰 템플릿
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<p th:text="${data}">empty</p>
</body>
</html>
Last updated
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<p th:text="${data}">empty</p>
</body>
</html>
Last updated
@RequestMapping("/response-view-v1")
public ModelAndView responseViewV1(){
ModelAndView mav = new ModelAndView("response/hello")
.addObject("data","hello!");
return mav;
}@RequestMapping("/response-view-v2")
public String responseViewV2(Model model){
model.addAttribute("data","hello!");//모델에 데이터 넣어준다!
return "response/hello";//@Controller이면서 String 반환 = 뷰의 논리적 이름
}@RequestMapping("/response/hello")
public void responseViewV3(Model model){
model.addAttribute("data","hello!");//모델에 데이터 넣어준다!
}