In the process of using springboot, if you use thymeleaf as a template file, the HTML format must be strict html5 format, there must be an end tag, otherwise an error will be reported! The solution is as follows:
1. You can use strict tags, that is, each tag has an end tag. This possibility It’s troublesome
2. Add spring.thymeleaf.mode=LEGACYHTML5 in application.properties, which means that thymeleaf uses non-strict HTML. After starting, the following error will be reported when accessing the page:
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" 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. at org.thymeleaf.templateparser.html.AbstractHtmlTemplateParser.parseTemplate(AbstractHtmlTemplateParser.java:90) ~[thymeleaf-2.1.5.RELEASE.jar:2.1.5.RELEASE] at org.thymeleaf.TemplateRepository.getTemplate(TemplateRepository.java:278) ~[thymeleaf-2.1.5.RELEASE.jar:2.1.5.RELEASE] at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1104) ~[thymeleaf-2.1.5.RELEASE.jar:2.1.5.RELEASE] at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1060) ~[thymeleaf-2.1.5.RELEASE.jar:2.1.5.RELEASE]
The above exception has been made very clear. You need to rely on nekoHTML 1.9.15 or newer version. The maven dependencies are as follows
## /groupId>The above is the detailed content of Parsing springboot using thymeleaf times html has no closing tag. For more information, please follow other related articles on the PHP Chinese website!