* 타임리프 파일은 무조건 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. 화면 확인

'MAC DEV > [mac]STS 웹 프로젝트 세팅' 카테고리의 다른 글
05. mySql 설치 및 mySql 설정 (0) | 2021.04.14 |
---|---|
04. Model 객체생성(builder 패턴) + 타임리프 적용 테스트 (0) | 2021.04.13 |
02. STS4 프로젝트 생성 (Spring Starter Project) (0) | 2021.04.11 |
01. sts 설치 + lombok(롬복) 세팅 (0) | 2021.04.10 |
[MAC OS] 스프링 웹 프로젝트 세팅 (0) | 2021.04.10 |