Parsing springboot using thymeleaf times html has no closing tag

高洛峰
Release: 2017-03-31 11:20:49
Original
5660 people have browsed it

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]
Copy after login

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>

nekohtml

1.9.22

Now you can access it normally.

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template