问题

SpringBoot使用thymeleaf模板引擎时报错:

org.xml.sax.SAXParseException: 元素类型 “link” 必须由匹配的结束标记 “</link>” 终止

or

org.xml.sax.SAXParseException: 元素类型 “meta” 必须由匹配的结束标记 “</meta>” 终止

解决

解决方法是在pom.xml文件中指定具体的thymeleaf版本具体如下

<properties>
    <java.version>1.8</java.version>
    <!--添加下面两项指定thymeleaf的版本-->
    <thymeleaf.version>3.0.2.RELEASE</thymeleaf.version>
    <thymeleaf-layout-dialect.version>2.0.5</thymeleaf-layout-dialect.version>
</properties>

YOLO