Springboot 1.5.2 thymeleaf label not closed exception workaround

Source: Internet
Author: User
Org.thymeleaf.exceptions.TemplateInputException:Exception parsing document:template= "Login"

Reason:

Spring boot Project when rendering HTML, because the default use is Thymeleaf template engine, encountered non-closed label error, Daily in the writing of HTML code, general tags are closed, easy to ignore the tags include <meta/>, <link/ , <br/>,

Workaround:

Added in Applications.properties:

Spring.thymeleaf.mode=legacyhtml5

Org.thymeleaf.exceptions.ConfigurationException:Cannot perform conversion to XML from Legacy html:the nekohtml Library I s not in Classpath. Nekohtml 1.9.15 or newer is required for processing templates in "LEGACYHTML5", missing packets.

Workaround:

Add in Build.gradle

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

Springboot 1.5.2 thymeleaf label not closed exception workaround

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.