首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Spring Boot和Thymeleaf Neko HTML错误

Spring Boot和Thymeleaf Neko HTML错误
EN

Stack Overflow用户
提问于 2016-09-06 18:42:29
回答 2查看 4.5K关注 0票数 3

我试着用Spring和Thymeleaf运行一个例子。我明白这个错误:

出现了意外错误(type=Internal服务器错误,status=500)。无法执行从遗留HTML到XML的转换: nekoHTML库不在类路径中。在“nekoHTML”模式下处理模板需要LEGACYHTML5 1.9.15或更高版本

这些是我的依赖:

代码语言:javascript
复制
    <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>

这是我的应用程序属性:

代码语言:javascript
复制
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依赖项时,错误就消失了。但是,应该通过我当前的依赖项来包含它。有什么问题吗?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2016-09-07 06:43:04

对于Maven,只需添加以下依赖项:

依赖关系:树-Dincludes=net.sourceforge.nekohtml:nekohtml

无结果

春季启动-胸腺网似乎不包括nekohtml库。

对于gradle,您可以在https://mvnrepository.com/artifact/net.sourceforge.nekohtml/nekohtml中找到您想要的版本,并找到如下所示的gradle包含脚本:

代码语言:javascript
复制
compile group: 'net.sourceforge.nekohtml', name: 'nekohtml', version: '1.9.22'
票数 5
EN

Stack Overflow用户

发布于 2018-02-11 16:05:44

将此添加到pom.xml

代码语言:javascript
复制
<!-- https://mvnrepository.com/artifact/net.sourceforge.nekohtml/nekohtml -->
<dependency>
    <groupId>net.sourceforge.nekohtml</groupId>
    <artifactId>nekohtml</artifactId>
    <version>1.9.22</version>
</dependency>
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39355821

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档