IntelliJのSpring boot + Thymeleafで変数を参照できない
1247 ワード
IntelliJでコントローラからHTML(Thymeleaf) に渡した変数に警告文が出ているためこれを解決
model.addAttribute("title", "ユーザ一覧");
←Controllerのこの子
確認1
xmlns:th="http://www.thymeleaf.org"
で名前空間を宣言しているか
test.html
<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
︙
︙
(省略)
確認2
IntelliJで必要なプラグインがインストールされているか
Ctrl + Alt + S
でSetting画面を表示Pluginで
Thymeleaf + Spring関係がインストールされているか確認する
自分の場合Spring MVCがインストールされていなかったため警告文が表示されていた。
これでHTMLからコントローラまで一気に飛べるようになった!
やったぜ\(^o^)/
Author And Source
この問題について(IntelliJのSpring boot + Thymeleafで変数を参照できない), 我々は、より多くの情報をここで見つけました https://qiita.com/SSM3G/items/4454f60d7b6783a9ca6b著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .