admin管理员组

文章数量:1130349

文章目录

  • Springboot+thymeleaf+IDEA——版本差异,解决HTML内标签不闭合导致的404问题
        • 1、thymeleaf 2
        • 2、thymeleaf 3

Springboot+thymeleaf+IDEA——版本差异,解决HTML内标签不闭合导致的404问题


1、thymeleaf 2

在thymeleaf 2 内编写单标签时,如果标签没有闭合,则会导致该资源发生404

<meta charset="utf-8" >
<img src="" >

必须给标签进行闭合或者改为双标签


<meta charset="utf-8" ></meta>
<img src="" ></img>


<meta charset="utf-8"  />
<img src=""  />
2、thymeleaf 3

thymeleaf 3 不再需要标签完全闭合,支持单标签写法,可以比较好的兼容HTML

在springboot 中,可以通过设置如下属性来使用thymeleaf 3 版本


    <properties>
        <java.version>1.8</java.version>
        <thymeleaf.version>3.0.0.RELEASE</thymeleaf.v

文章目录

  • Springboot+thymeleaf+IDEA——版本差异,解决HTML内标签不闭合导致的404问题
        • 1、thymeleaf 2
        • 2、thymeleaf 3

Springboot+thymeleaf+IDEA——版本差异,解决HTML内标签不闭合导致的404问题


1、thymeleaf 2

在thymeleaf 2 内编写单标签时,如果标签没有闭合,则会导致该资源发生404

<meta charset="utf-8" >
<img src="" >

必须给标签进行闭合或者改为双标签


<meta charset="utf-8" ></meta>
<img src="" ></img>


<meta charset="utf-8"  />
<img src=""  />
2、thymeleaf 3

thymeleaf 3 不再需要标签完全闭合,支持单标签写法,可以比较好的兼容HTML

在springboot 中,可以通过设置如下属性来使用thymeleaf 3 版本


    <properties>
        <java.version>1.8</java.version>
        <thymeleaf.version>3.0.0.RELEASE</thymeleaf.v

本文标签: 差异版本标签ThymeleafSpringBoot