我试着用Spring和Thymeleaf运行一个例子。我明白这个错误:
出现了意外错误(type=Internal服务器错误,status=500)。无法执行从遗留HTML到XML的转换: nekoHTML库不在类路径中。在“nekoHTML”模式下处理模板需要LEGACYHTML5 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依赖项时,错误就消失了。但是,应该通过我当前的依赖项来包含它。有什么问题吗?
发布于 2016-09-07 06:43:04
对于Maven,只需添加以下依赖项:
依赖关系:树-Dincludes=net.sourceforge.nekohtml:nekohtml
无结果
春季启动-胸腺网似乎不包括nekohtml库。
对于gradle,您可以在https://mvnrepository.com/artifact/net.sourceforge.nekohtml/nekohtml中找到您想要的版本,并找到如下所示的gradle包含脚本:
compile group: 'net.sourceforge.nekohtml', name: 'nekohtml', version: '1.9.22'发布于 2018-02-11 16:05:44
将此添加到pom.xml中
<!-- https://mvnrepository.com/artifact/net.sourceforge.nekohtml/nekohtml -->
<dependency>
<groupId>net.sourceforge.nekohtml</groupId>
<artifactId>nekohtml</artifactId>
<version>1.9.22</version>
</dependency>https://stackoverflow.com/questions/39355821
复制相似问题