Idea引入thymeleaf失败解决方法

报错

复制代码
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.

Fri Sep 29 09:42:00 CST 2023
There was an unexpected error (type=Not Found, status=404).

原因:html没有使用thymeleaf

首先要引入:

xmlns:th="http://www.thymeleaf.org"

复制代码
<html lang="en"  xmlns:th="http://www.thymeleaf.org">

如果不行

在setting-->plugins-->搜索thymeleaf

会出来个插件,下载,应用

最后,如果还有问题

类似与这样 显示为灰色

那就是在写的代码有问题

上图正确的应该是:

复制代码
<h1 th:text="${city}"></h1>
相关推荐
伍华聪4 分钟前
基于Vant4+Vue3+TypeScript的H5移动前端
前端
Nayana5 分钟前
axios-取消重复请求--CancelToken&AbortController
前端·axios
云动雨颤11 分钟前
Linux下PXE服务器搭建
linux·运维·服务器
大舔牛13 分钟前
网站性能优化:小白友好版详解
前端·面试
转转技术团队21 分钟前
你的H5页面在折叠屏上适配了吗?
前端
北辰浮光33 分钟前
[Web数据控制]浏览器中cookie、localStorage和sessionStorage
前端·vue.js·typescript
wanhengidc35 分钟前
云手机会占用本地手机内存吗?
运维·服务器·网络·安全·智能手机
Dolphin_海豚36 分钟前
charles proxying iphone
前端·ios