org.thymeleaf.exceptions.TemplateInputException: Exception parsing document: template="login"

原因:

Spring Boot项目渲染html的时候,因默认使用是Thymeleaf模板引擎,遇到不闭合标签报错,日常在编写HTML代码时,一般标签都是闭合的,容易忽略的标签包括<meta/>, <link/>, <br/>, <hr/>等等

解决办法:

applications.properties 中添加:

spring.thymeleaf.mode=LEGACYHTML5

org.thymeleaf.exceptions.ConfigurationException: 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" ,缺包。

解决办法:

build.gradle 中添加

compile("net.sourceforge.nekohtml:nekohtml:1.9.22")

 

相关文章:

  • 2022-12-23
  • 2021-12-02
  • 2021-06-07
  • 2021-05-25
  • 2021-12-04
  • 2021-06-27
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-06
  • 2021-09-11
  • 2021-07-04
  • 2022-12-23
  • 2021-06-08
  • 2022-12-23
相关资源
相似解决方案