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>
相关推荐
学嵌入式的小杨同学36 分钟前
从零打造 Linux 终端 MP3 播放器!用 C 语言实现音乐自由
linux·c语言·开发语言·前端·vscode·ci/cd·vim
weixin_425543731 小时前
TRAE CN3.3.25 构建的Electron简易DEMO应用
前端·typescript·electron·vite·nestjs
郝亚军2 小时前
如何在Ubuntu和win10/11之间通过samba访问对方的文件
linux·服务器·ubuntu
Mr Xu_2 小时前
【Vue3 + ECharts 实战】正确使用 showLoading、resize 与 dispose 避免内存泄漏
前端·信息可视化·vue·echarts
0思必得02 小时前
[Web自动化] Selenium设置相关执行文件路径
前端·爬虫·python·selenium·自动化
雯0609~2 小时前
hiprint:实现项目部署与打印1-官网提供普通html版本
前端·html
yuezhilangniao2 小时前
AI智能体全栈开发工程化规范 备忘 ~ fastAPI+Next.js
javascript·人工智能·fastapi
不绝1913 小时前
UGUI——进阶篇
前端
Exquisite.3 小时前
企业高性能web服务器(4)
运维·服务器·前端·网络·mysql
铅笔侠_小龙虾4 小时前
Flutter Demo
开发语言·javascript·flutter