実現したいこと
hello.htmlに飛びたい
前提
ここに質問の内容を詳しく書いてください。
(例)
eclipse 2022年版をつかって開発をしています。
spring bootの基礎を学ぼうとしたところ、RequestMappingの箇所でエラーが出てしまいました。
発生している問題・エラーメッセージ
hello.htmlが表示されない
エラーメッセージ
Error resolving template [hello], template might not exist or might not be accessible by any of the configured Template Resolvers
該当のソースコード
フォルダ階層は以下です
HelloController.java
1 2package com.example.demo.controller; 3 4import org.springframework.stereotype.Controller; 5import org.springframework.web.bind.annotation.RequestMapping; 6 7@Controller 8public class HelloController { 9 10 @RequestMapping("/") 11 public String index() { 12 13 return "hello"; 14 } 15} 16
hello.html
1<!DOCTYPE html> 2<html xmlns:th="http://www.thymeleaf.org"> 3<head> 4<meta charset="UTF-8"> 5<title>Hello World</title> 6</head> 7<body> 8 <h2>Hello World</h2> 9</body> 10</html>
試したこと
Controllerの階層を変更してみた
補足情報(FW/ツールのバージョンなど)
eclipse2022年版
thymeleaf
spring boot

回答1件
あなたの回答
tips
プレビュー
下記のような回答は推奨されていません。
このような回答には修正を依頼しましょう。
また依頼した内容が修正された場合は、修正依頼を取り消すようにしましょう。