springboot使用thymeleaf 解析异常
来源:互联网 发布:ubuntu des 解密 编辑:程序博客网 时间:2024/05/29 10:33
在使用springboot的过程中,如果使用thymeleaf作为模板文件,则要求HTML格式必须为严格的html5格式,必须有结束标签,否则会报错!解决办法如下:
1、你可以使用严格的标签,也就是每个标签都有结束标签,这种可能比较麻烦
2、在application.properties中增加
spring.thymeleaf.content-type=text/html spring.thymeleaf.cache=false spring.thymeleaf.mode =LEGACYHTML5
即声明thymeleaf使用非严 格的html。启动之后访问页面会报如下错误:
org.thymeleaf.exceptions.ConfigurationException: Cannot perform conversion to XML from legacy HTML: The nekoHTML library is not in classpath. nekoHTML 1.9.15 or newer is required for processing templates in "LEGACYHTML5" mode [http://nekohtml.sourceforge.net]. Maven spec: "net.sourceforge.nekohtml::nekohtml::1.9.15". IMPORTANT: DO NOT use versions of nekoHTML older than 1.9.15.
上面的异常已经说的很清楚了,需要依赖nekoHTML 1.9.15 or newer的版本。maven依赖如下
<dependency> <groupId>net.sourceforge.nekohtml</groupId> <artifactId>nekohtml</artifactId> <version>1.9.22</version> </dependency>
阅读全文
0 0
- springboot使用thymeleaf 解析异常
- SpringBoot使用thymeleaf
- springboot(四):thymeleaf使用详解
- SpringBoot使用thymeleaf模板引擎
- Springboot+Thymeleaf配置与使用
- SpringBoot (四) :thymeleaf 使用详解
- springboot(四):thymeleaf使用详解
- springboot(四):thymeleaf使用详解
- springboot中使用thymeleaf模板
- springboot(四):thymeleaf使用详解
- SpringBoot -- thymeleaf
- springboot-thymeleaf
- SpringBoot-thymeleaf
- SpringBoot + thymeleaf
- springboot thymeleaf
- Springboot 中 使用thymeleaf 显示自定义Logo
- SpringBoot使用thymeleaf的简单记录
- SpringBoot--使用Thymeleaf模板开发web项目
- RadioButton和CheckBox的区别及使用场景
- gVim打造成成IDE
- 创建进程程序-2.主函数
- 【iOS沉思录】GCD实现线程同步的方法
- BlockingQueue之PriorityBlockingQueue要点详解
- springboot使用thymeleaf 解析异常
- zabbix3.2监控JVM状态
- 有道词典案例
- 20170602-leetcode-211-Add and Search Word
- 搭建《UNIX环境高级编程》环境
- MySQL innoDB索引底层原理详解
- Python练习题 9-1 餐馆~9-3用户
- grep命令
- java--不重复随机数及Arrays.equals()