报错
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 [http://nekohtml.sourceforge.net]. Maven spec: “net.sourceforge.nekohtml::nekohtml::1.9.15”. IMPORTANT: DO NOT use versions of nekoHTML older than 1.9.15.
翻译:org.thymeleaf.exceptions。ConfigurationException:不能执行从遗留HTML到XML的转换:nekoHTML库不在类路径中。在“LEGACYHTML5”模式下处理模板需要nekoHTML 1.9.15或更新版本[http://nekohtml.sourceforge.net]。Maven规范:“net.sourceforge.nekohtml:: nekohtml:: 1.9.15”。注意:不要使用超过1.9.15的nekoHTML版本。
在org.thymeleaf.templateparser.html.AbstractHtmlTemplateParser.parseTemplate (AbstractHtmlTemplateParser.java: 90) ~ (thymeleaf-2.1.6.RELEASE.jar 2.1.6.RELEASE)
解决
<dependency>
<groupId>net.sourceforge.nekohtml</groupId>
<artifactId>nekohtml</artifactId>
<version>1.9.22</version>
</dependency>
application.properties里要有这一句:
spring.thymeleaf.mode=LEGACYHTML5