java – Spring Boot和Thymeleaf Neko HTML错误
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了java – Spring Boot和Thymeleaf Neko HTML错误,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1736字,纯文字阅读大概需要3分钟。
内容图文
![java – Spring Boot和Thymeleaf Neko HTML错误](/upload/InfoBanner/zyjiaocheng/727/733ed64171d140d2917de01d7d503dbe.jpg)
我试图用Spring Boot和Thymeleaf运行一个例子.我收到了这个错误:
There was an unexpected error (type=Internal Server Error,
status=500). 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
这些是我的依赖:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jersey</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-springsecurity4</artifactId>
<version>2.1.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
这是我的应用程序属性:
spring.thymeleaf.cache=false
spring.thymeleaf.suffix=.html
spring.thymeleaf.mode=LEGACYHTML5
spring.thymeleaf.encoding=UTF-8
spring.thymeleaf.content-type=text/html
当我添加Neko HTML依赖性错误消失.但是它应该通过我当前的依赖项包含在内.可能是什么问题?
解决方法:
对于Maven,简单地添加这个依赖:
mvn依赖:tree -Dincludes = net.sourceforge.nekohtml:nekohtml
结果没什么
似乎spring-boot-thymeleaf不包括nekohtml库.
对于gradle,您可以在https://mvnrepository.com/artifact/net.sourceforge.nekohtml/nekohtml中找到所需的版本,并找到gradle include脚本,如下所示:
compile group: 'net.sourceforge.nekohtml', name: 'nekohtml', version: '1.9.22'
内容总结
以上是互联网集市为您收集整理的java – Spring Boot和Thymeleaf Neko HTML错误全部内容,希望文章能够帮你解决java – Spring Boot和Thymeleaf Neko HTML错误所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。