해결된 질문
작성
·
402
0
----------------HelloController-------------
package hello.hellospring.contoller;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
@Controller
public class HelloController {
@GetMapping("hello")
public String hello(Model model)
{
model.addAttribute("data", "hello!!");
return "hello";
}
}
---------hello.html---------------
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="content-type" content="text/html" charset="UTF-8" />
<title>Title</title>
</head>
<body>
<p th:text="'안녕하세요'. + ${data}"> 안녕하세요. 손님</p>
</body>
</html>
자꾸
This application has no explicit mapping for /error, so you are seeing this as a fallback.