java nekohtml,java – Spring Boot和Thymeleaf Neko HTML错误
我試圖用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
這些是我的依賴:
org.springframework.boot
spring-boot-starter-jersey
org.springframework.boot
spring-boot-starter-security
org.springframework.boot
spring-boot-starter-thymeleaf
org.thymeleaf.extras
thymeleaf-extras-springsecurity4
2.1.2.RELEASE
org.springframework.boot
spring-boot-starter-web
org.springframework.boot
spring-boot-starter-test
test
這是我的應用程序屬性:
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庫.
compile group: 'net.sourceforge.nekohtml', name: 'nekohtml', version: '1.9.22'
標簽:java,spring,spring-boot,spring-mvc,thymeleaf
來源: https://codeday.me/bug/20190828/1756320.html
總結
以上是生活随笔為你收集整理的java nekohtml,java – Spring Boot和Thymeleaf Neko HTML错误的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Vue团队核心成员开发的39行小工具 i
- 下一篇: [html] 当img标签中的src图