spring-boot thymeleaf对没有结束符的HTML5标签解析出错解决办法
2017-08-03 10:02
465 查看
原文来自:http://blog.csdn.net/ngl272/article/details/70215435
问题:
使用springboot的thymeleaf模板时默认会对HTML进行严格的检查,导致当你的标签没有闭合时就会通不过,例如://要想通过,后面的闭合必须写成 /> <meta charset="UTF-8">1
2
1
2
个人发现不仅是HTML代码会这样,js代码同样会这样,例如:
//这里的i<10同样通不过 for(var i=0;i<10;i++){ ... }1
2
3
4
1
2
3
4
解决办法:
引入nokohtml库<!--启用不严格检查html--> <dependency> <groupId>net.sourceforge.nekohtml</groupId> <artifactId>nekohtml</artifactId> <version>1.9.22</version> </dependency>1
2
3
4
5
6
1
2
3
4
5
6
修改配置文件application_dev.yml加入
thymeleaf: mode: LEGACYHTML51
2
1
2
大功告成。
相关文章推荐
- spring-boot thymeleaf对没有结束符的HTML5标签解析出错解决办法
- spring-boot thymeleaf对没有结束符的HTML5标签解析出错解决办法
- thymeleaf模板对没有结束符的HTML5标签解析出错的解决办法
- thymeleaf模板对没有结束符的HTML5标签解析出错的解决办法
- thymeleaf模板对没有结束符的HTML5标签解析出错的解决办法
- thymeleaf解析html5标签出错(没有结束符)解决办法
- spring-boot-starter-thymeleaf对没有结束符的HTML5标签解析出错
- Thymeleaf模板HTML5没有结束标签解决办法
- thymeleaf对没有结束符的HTML5标签解析出错
- 解决spring-boot thymeleaf模板对非严格HTML5格式文件的解析
- 开发Struts 2项目遇到的一个问题,就是在struts-tags标签库下没有了s:datetimepicker标签的解决办法
- html5 <video>播放mp4格式视频没有图像的解决办法
- JSP页面中使用JSTL标签出现无法解析问题解决办法
- android导入代码出错,没有android包解决办法
- spring配置文件dubbo标签报错解决办法
- IDEA调试SpringMvc项目时,出错:java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener,解决办法
- 360市场aapt命令执行出错(appt 解析报错)解决办法
- 没有闭合(结束)标签XML文件的解析
- 使用Struts2标签出错,解决办法