解决:org.xml.sax.SAXParseException: 元素类型 "head" 必须由匹配的结束标记 "</head>问题
事件背景:
今天就碰到了这样的问题,
- org.xml.sax.SAXParseException: 元素类型 "head" 必须由匹配的结束标记 "</head>
我本地编译的时候报错,上面报错,起初 我以为是我画的html页面报错呢,一个个标签查呀,查了一个多小时没结果
原因:
spring-boot-starter-thymeleaf对html5默认校验要求高。一言不合就报错如下:
解决方案:
1、在pom.xml中添加依赖
- <!--启用不严格检查html-->
- <dependency>
- <groupId>net.sourceforge.nekohtml</groupId>
- <artifactId>nekohtml</artifactId>
- <version>1.9.22</version>
- </dependency>
2、在 application.properties
2.1、关闭缓存
- spring.thymeleaf.cache=false
2.2、修改
- spring.thymeleaf.mode=LEGACYHTML5
参考文章:https://blog.csdn.net/zpengf/article/details/80096346
解决:org.xml.sax.SAXParseException: 元素类型 "head" 必须由匹配的结束标记 "</head>问题的更多相关文章
- org.xml.sax.SAXParseException: 元素类型 "input" 必须由匹配的结束标记 "</input>" 终止。
错误记录 Spring Boot推荐使用thymeleaf作为视图,按照SpringBoot实战一书的案例写Demo. 发生错误: org.xml.sax.SAXParseException: 元素类 ...
- 元素类型 “meta” 必须由匹配的结束标记 “” 终止
报错 org.xml.sax.SAXParseException: 元素类型 “meta” 必须由匹配的结束标记 “” 终止 系统自动创建 <meta charset="UTF-8&q ...
- Parse Fatal Error at line 41 column 24: 元素类型 "url-pattern" 必须由匹配的结束标记 "</url-pattern>" 终止
1.错误描述 严重: Parse Fatal Error at line 41 column 24: 元素类型 "url-pattern" 必须由匹配的结束标记 "< ...
- org.xml.sax.SAXParseException: 元素内容必须由格式正确的字符数据或标记组成,的错误问题
当时在mapper其中的一个语句是case when ISNULL(b.c_truename) || LENGTH(TRIM(b.c_truename)) < 1 then b.c_ch_nam ...
- thymeleaf报错元素类型必须由匹配的结束标记终止
spring boot 1.x 版本中thymeleaf报错元素类型 “link” 必须由匹配的结束标记 “</link>” 终止解决办法: 1.在pom.xml文件中添加: <de ...
- Spring错误——Spring xml注释——org.xml.sax.SAXParseException; lineNumber: 24; columnNumber: 10; cvc-complex-type.2.3: 元素 'beans' 必须不含字符 [子级], 因为该类型的内容类型为“仅元素”。
背景:配置spring xml,注释xml中文件元素 错误: Caused by: org.xml.sax.SAXParseException; lineNumber: 24; columnNumbe ...
- org.xml.sax.SAXParseException; lineNumber: 14; columnNumber: 32; 元素类型为 "key" 的内容必须匹配 "(column)*"
报错:部分错误信息,主要查看CauseBy Caused by: org.hibernate.InvalidMappingException: Unable to read XML at org.hi ...
- spring整合mybatis错误:Caused by: org.xml.sax.SAXParseException; lineNumber: 5; columnNumber: 62; 文档根元素 "mapper" 必须匹配 DOCTYPE 根 "configuration"。
运行环境:jdk1.7.0_17+tomcat 7 + spring:3.2.0 +mybatis:3.2.7+ eclipse 错误:Caused by: org.xml.sax.SAXParseE ...
- Cause: org.xml.sax.SAXParseException; lineNumber: 45; columnNumber: 62; 元素内容必须由格式正确的字符数据或标记组成。
三月 09, 2018 12:13:39 下午 org.apache.catalina.core.StandardContext listenerStart严重: Exception sending ...
随机推荐
- [Android] Android v4包CompoundButtonCompatLollipop.class重复问题
用 Butter Knife 8.8.1 导致v4包CompoundButtonCompatLollipop.class重复问题 详细错误如下: Error:Execution failed fo ...
- Silverlight网页打开后马上崩溃,“白屏”,而且毫无提示
如题,出现白屏的问题 在Application_UnhandledException函数内,跟踪异常e的提示信息,可以了解到如下信息: at System.ComponentModel.AsyncCo ...
- you have mixed tabs and spaces.Fix This屏蔽
这个功能很影响vs的速度,解决办法(VS2010版本为例),将Fix Mixed Tabs改为OFF即可.
- 传入mybatis的xml为Long型时报There is no getter for property named 'VARCHAR' in
修改前 <insert id="insert" parameterType="com.taotao.pojo.TbContent" > i ...
- Redis Fun使用
using Newtonsoft.Json; using StackExchange.Redis; using System; using System.Configuration; using Sy ...
- oracle 启动em (使用浏览器打开)
在cmd命令中执行 emctl status dbconsole 如果报错,确实oracle_UNQNAME 这个时候需要设置变量 oracle_hostname 和oracle_unqname 执行 ...
- js 中编码(encode)和解码(decode)的三种方法
js对文字进行编码涉及3个函数:escape,encodeURI,encodeURIComponent,相应3个解码函数:unescape,decodeURI,decodeURIComponent 下 ...
- 浏览器支持webp格式
使用插件http://www.etherdream.com/WebP/WebP.js
- 30个极大提高开发效率的vscode插件
参考链接:https://blog.fundebug.com/2018/07/24/vs-extensions/
- IndexedDB API
参考链接:https://wangdoc.com/javascript/bom/indexeddb.html