Sptingboot:thymeleaf中使用Ajax
不了解thymeleaf的可以参考 : 这是一个链接
1.在pom.xml导入thymeleaf需要的jar包
在pom.xml里面添加以下代码
<!--th标签需要的架包-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>nz.net.ultraq.thymeleaf</groupId>
<artifactId>thymeleaf-layout-dialect</artifactId>
</dependency>
2.在html导入th标签
在html标签添加以下代码
<html lang="en" xmlns:th="http://www.thymeleaf.org">
3.在html页面添加一个a标签
在html标签添加以下代码
<