나는 내 템플릿 디렉토리를 찾을 수 없습니다 ThymeleafThymeleaf 봄 부팅 프로젝트 내부의 템플릿을 감지 할 수
projectName
-Gradle-Module1(Spring boot module)
-build
-src
-main
-resources
-templates
index.html
build.gradle
-Gradle-Module2
...
build.gradle
...
하지만 봄 부팅을 사용하려는 인 나의 봄 부팅 응용 프로그램에서 다음 프로젝트 구조를 가지고 경고
Cannot find template location: classpath:/templates/ (please add some templates or check your Thymeleaf configuration)
PS를 보여주는 : 나는 내가
과 같은 일을하고 내 컨트롤러 코드에서@EnableAutoConfiguration
을 사용하고 있습니다
@Controller
@EnableAutoConfiguration
public class BaseController {
@RequestMapping(value = "/")
public String index() {
return "index.html";
}
}
및 index.html
파일은 단지 hello world를 인쇄합니다.
그래서 일반적으로(내 생각과 동일한 Gradle 모듈)을 봐야하지만 어쨌든 찾을 수 없습니다.
내가 놓친 게 있나요 내가 오류 Error resolving template "index.html", template might not exist or might not be accessible by any of the configured Template Resolvers
아래 얻고있다 localhost:8080
에 액세스하려고 할 때?
감사합니다.
감사합니다.
이것은 훌륭한 질문입니다. 질문 주셔서 감사합니다! – devdanke