반응형
Thymeleaf를 통한 View페이지 매핑 (서버사이트 자바 템플릿 엔진)
package com.zerobase.fastlms;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class MainPage {
@RequestMapping("/")
public String index() {
return "index";
}
}
localhost:8080
템플릿 에러 발생
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<h1> 인덱스 페이지 !!!!</h1>
<p> 안녕하세요. </p>
</body>
</html>
Thymeleaf를 통하여 'templates/index.html' 로 매핑되어서 페이지가 보임
반응형
'cs > java-spring-boot' 카테고리의 다른 글
[Zero-base] 6-8. 회원가입 입력폼 HTML작성과 서버 전송 (0) | 2022.02.15 |
---|---|
[Zero-base] 6-7. 메인 페이지 작성 및 메뉴 링크 작성 (0) | 2022.02.15 |
[Zero-base] 6-5. Git Clone과 Response객체를 이용한 HTML작성 (0) | 2022.02.15 |
[Zero-base] 6-4. 브라우저에서 HTLML문서와 TEXT문서 보기 (0) | 2022.02.15 |
[Zero-base] 6-1. 프로젝트 세팅(eclipse) (0) | 2022.02.15 |