Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
| 29 | 30 | 31 |
Tags
- plan_table
- 카멜룰
- 초기데이터
- window7
- 인수배열
- 유용한사용법
- Marshalling
- filed
- arguements
- JExcel
- Jackson
- eclipse pliugin
- BiffException
- javascripts
- 유용한 표현
- mput
- WM_CONCAT
- svn ignore
- TypeReference
- camel rule
- put
- 유용한 코드
- 로우병합
- 호출
- New Project
- 구동하기
- json
- unmashalling
- spring boot
- XMLAGG
Archives
- Today
- Total
하루에 한가지
thymeleaf 추가 본문
pom.xml 추가
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
구동을 해보면
Cannot find template location: classpath:/templates/ (please add some templates, check your Thymeleaf configuration, or set spring.thymeleaf.check-template-location=false)
위와 같은 메시지가 뜬다.
라이브러리는 잘 추가가 된 것을 확인 할 수 있고.
해당 디렉토리에 아무 html을 추가하면 해당 로그가 사라지는 것을 확인할 수 있다.
contoller까지 추가해서 연결을 해보면.
package com.urbug2.web.sample.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@Controller
@RequestMapping("samples")
public class SampleThymeleafController {
@RequestMapping(method=RequestMethod.GET)
public String sample() {
return "samples"; // /main/resources/templates/samples.html
}
}
/main/resources/templates/samples.html
경로에 임의 파일을 추가하면
<!DOCTYPE html>
<html>
<head>
<meta charset="EUC-KR">
<title>Sample</title>
</head>
<body>
Sample Pages
</body>
</html>

정상적으로 연결된 것을 확인할 수 있다.
Comments