Spring Boot和Thymeleaf Neko HTML错误

卡马奇

我正在尝试使用Spring Boot和Thymeleaf运行示例。我得到那个错误:

发生意外错误(类型=内部服务器错误,状态= 500)。无法从旧版HTML转换为XML:nekoHTML库不在类路径中。在“ LEGACYHTML5”模式下处理模板需要nekoHTML 1.9.15或更高版本

这些是我的依赖项:

    <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'

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

Spring Boot和Thymeleaf-到另一个站点的“ a href”进入404错误

Spring Boot + Thymeleaf的@WebAppConfiguration和@ContextConfiguration

Spring Boot和Thymeleaf-删除严格的HTML错误检查

Spring-boot thymeleaf从类路径加载HTML文件

Spring Boot和Thymeleaf在字段错误上返回400错误

Spring Boot和Thymeleaf:链接列表

Spring Boot和Thymeleaf:链接列表

在HTML中调用Java方法/变量-Thymeleaf Spring Boot

与Spring和Thymeleaf的注销链接;发布错误

Thymeleaf和Spring Boot,如何构造资源文件夹以在运行时和设计时查看html

Spring Boot Thymeleaf:如何包含html文件

Spring Boot 2.0.3 thymeleaf错误呈现某些页面

Spring Boot-Thymeleaf和Json模板

控制器未使用Spring Boot和Thymeleaf从HTML的跨度中接收值

使用Spring Boot和Thymeleaf进行分页

Spring Boot,Thymeleaf和@Controller

使用Spring Boot和Thymeleaf发送HTML电子邮件

Spring Boot和Thymeleaf与XML模板

neko_vm_custom()和neko_vm_set_custom()有什么用途?

Spring Boot + Thymeleaf自定义错误消息

Spring Boot和Thymeleaf不处理模板

使用Spring Boot和Thymeleaf时如何调试404错误?

Thymeleaf 3和Spring Boot 2.1的模板解析错误

Thymeleaf,Spring Boot 2:处理错误时资源的无效路径

Spring Boot和Thymeleaf:找不到HTML模板

在 Spring Boot 中,在单击事件 Html 页面重定向和使用 Jquery /Thymeleaf 加载下拉组件中的值期间

Spring Boot 和 Thymeleaf 的问题

Spring Boot、Thymeleaf 和 CSS

src/main/resources/templates/ 下 index.html 上的 Spring Boot Thymeleaf 解析错误