* 타임리프 파일은 무조건 src/main/resources/templates 아래에 존재

 

 

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org"
	xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">
	<title>Sample</title>
	<body>
		<h2>This is Sample</h2>
	</body>
</html>

 

 

2. SampleController 수정

@Controller
public class SampleController {
	
    @GetMapping("/sample")
	public String goHome(HttpServletRequest request) {
		return "sample/sample";
	}
}

 

 

3. 화면 확인

+ Recent posts