解决thymeleaf模板中,对html标签要求太严格的问题
程序员文章站
2022-05-01 23:01:30
...
平日使用thymeleaf时,发现使用要求非常严格,比如<input type="text" />
单标签结尾便会报错,只有这样<input type="text" > </input>
才可以。
为了解决这种严格的使用规则,可以添加如下依赖:
<!--thymeleaf的依赖包-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<!--为了解决thymeleaf模板中,对html标签要求太严格的问题!-->
<dependency>
<groupId>net.sourceforge.nekohtml</groupId>
<artifactId>nekohtml</artifactId>
<version>1.9.22</version>
</dependency>
上一篇: 饭店、商场和医疗冷笑话
下一篇: 后台部署jar包运行