纠结了好久,网上很多人说用ajax,其实不用这么麻烦,用thymeleaf模板就好
加上这两行,
xmlns="http://www.w3.org/1999/xhtml" xmlns:th=http://www.thymeleaf.org
就可以得到了