エラー:template might not exist or might not be accessible by any of the configured Template Resolvers
和訳:テンプレートが存在しないか、構成されたテンプレートリゾルバのいずれからもアクセスできない可能性があります。
修正前ソース内容
src/main/java/com.example.demo/HelloController.java
package com.example.demo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class HelloController {
@RequestMapping(value="/hello")
private String hello(){
return "hello";
}
}
src/main/resources/templates/hello.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
hello
</body>
</html>
1,controllerクラスのreturnする文字列を修正(hello.html→hello)
package com.example.demo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class HelloController {
@RequestMapping(value="/hello")
private String hello(){
return "hello";
}
}
2,springbootを停止して再起動
3,chromeをキャッシュクリーン(shift + f5)
※解決に数時間もかけてしまった...