• 在Intellij Idea下使用Thymeleaf时,会报th命名空间不存在的错误,如th:href。
<!DOCTYPE html>
<html>
<head><title>Hello</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><link href="http://cdn.jsdelivr.net/webjars/bootstrap/3.3.2/css/bootstrap.min.css"th:href="@{/webjars/bootstrap/3.3.2/css/bootstrap.min.css}"rel="stylesheet" media="screen"/><link href="/css/justified-nav.css" />
</head>
<body>
</body>
</html>
  • 这时因为在html根元素缺少命名空间声明:xmlns:th=“http://www.thymeleaf.org”。 解决办法如下:
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd"><html xmlns="http://www.w3.org/1999/xhtml"xmlns:th="http://www.thymeleaf.org">
<head><title>Hello</title>
</head>
<body>
</body>
</html>
  • 如果使用spring,可以使用以下代码:
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd"><html xmlns="http://www.w3.org/1999/xhtml"xmlns:th="http://www.thymeleaf.org">
<head><title>Hello</title>
</head>
<body>
</body>
</html>

Intellij Idea: Thymeleaf 命名空间th报错相关推荐

  1. 【错误记录】Mac 中 IntelliJ IDEA 运行 Python 程序报错 ( pip 21.0 will drop support for Python 2.7 in January 20 )

    文章目录 一.报错信息 二.解决方案 一.报错信息 在 [错误记录]Mac 中 IntelliJ IDEA 运行 Python 程序报错 ( No module named 'threadpool' ...

  2. thymeleaf 使用页面报错_异常处理-SpringBoot中thymeleaf对应前台页面大于号\小于号使用问题...

    浏览器报错信息: There was an unexpected error (type=Internal Server Error, status=500). Exception parsing d ...

  3. 【错误记录】Mac 中 IntelliJ IDEA 运行 Python 程序报错 ( “Python“ 因为出现问题而无法打开 )

    文章目录 一.报错信息 二.解决方案 一.报错信息 先安装了 Pytnon3.10.0 版本 , 然后有安装了 Python3.6.3 版本 , 安装完成后 , IntelliJ IDEA 中就出现如 ...

  4. thymeleaf 使用页面报错_SpringBoot 使用thymeleaf 跳转页面时,总是提示404找不到页面...

    Thymeleaf的使用和版本关系很大,如果路径配置正确却一直无法正常返回,可能就是版本错误导致. 想构建简单页面跳转,正常跳转index.html,404和500跳转到专门的页面,配置正确,路径也正 ...

  5. 【错误记录】Mac 中 IntelliJ IDEA 运行 Python 程序报错 ( No module named ‘numpy‘ )

    文章目录 一.报错信息 二.解决方案 一.报错信息 编译时 , 报错如下信息 : No module named 'numpy' 二.解决方案 pip install numpy Try to run ...

  6. 【错误记录】Mac 中 IntelliJ IDEA 运行 Python 程序报错 ( End of statement expected )

    文章目录 一.报错信息 二.解决方案 一.报错信息 将 Python SDK 从 Python 2.7 升级为 Python3.10 后 , 报如下报错 ; 二.解决方案 将 print " ...

  7. com.intellij.execution.ExecutionException:at com.intellij.execution.rmi.RemoteProcessSupport.acqu报错

    当我从Gitee克隆到本地是,idea编译器报错,解决方案如下: 然后选中: 解决 出现错误原因应该是克隆时编译器没有自动生成下列部分:

  8. 解决Intellij IDEA Tomcat启动项目报错:java.lang.ClassNotFoundException:org.springframework.web.context.Contex

    新建了一个maven项目,启动是报错java.lang.ClassNotFoundException:org.springframework.web.context.ContextLoaderList ...

  9. 解决IntelliJ IDEA报错Error:Cannot determine path to ‘tools.jar‘ library for 17 (C:\Program Files\Java\jd

    解决IntelliJ IDEA报错Error:Cannot determine path to 'tools.jar' library for 17 (C:\Program Files\Java\jd ...

最新文章

  1. 为什么总线要用一根来表示一bit
  2. java的继承_java中的继承(一)
  3. [试卷]古诗文背诵(七年级上学期)
  4. C# Socket网络编程精华篇
  5. filebeat 配置文件详解
  6. codevs 1048 石子归并
  7. smali注入常用代码
  8. 什么是php-fpm
  9. OpenCVSharp 4.5 去离焦模糊
  10. PayPal开发文档整理(8)——PayPal支付产品和解决方案
  11. 计算机操作系统——银行家算法
  12. CRM系统主要包含什么内容
  13. java实现手机扫二维码登陆
  14. LOFTER72D94FF8E0603DBE38066DB525285F1C
  15. 普通话测试哪个软件准确吗,免费普通话测试软件哪个好_哪个app可以免费测普通话_普通话测试软件准不准...
  16. 前端入门——JavaScript
  17. Xen虚拟机安装Windows8
  18. Stata:时间虚拟变量还是时间趋势项?
  19. 计算机b级及格线,计算机一级B考试有那些内容?理论部分不几个就算总分及格了也不算合格吗?...
  20. remote: Support for password authentication was removed

热门文章

  1. 嘀嗒还是滴答_2021年顺风车车主口碑榜!滴滴、滴答、一喂顺风车成TOP3
  2. (pytorch-深度学习)实现残差网络(ResNet)
  3. MySQL 深潜 - 一文详解 MySQL Data Dictionary
  4. 媒体智能-淘宝直播流媒体互动实践 | D2 分享视频+文章
  5. 使用CLONE TABLE方式实现同region不同可用区的MaxCompute
  6. 阿里主管通知我试用期延期……
  7. 蚂蚁金服开放计算架构:下一代金融级计算架构
  8. 企业级数据库新型研发模式——数据管理DMS实践
  9. 为什么选择Cassandra
  10. Apache Cassandra static column 介绍与实战