此方法通过thymeleaf模板引擎获取
1.pom.xml引入thymeleaf依赖
org.springframework.boot spring-boot-starter-thymeleaf
2.如图三部分,分别为包结构、html代码、controller代码,html头部定义
3.js中获取的话把input type设置为hidden,通过js,jq等都可以。(jq最好下载到本地引用,网上连接可能引入不进来)

此方法通过thymeleaf模板引擎获取
1.pom.xml引入thymeleaf依赖
org.springframework.boot spring-boot-starter-thymeleaf
2.如图三部分,分别为包结构、html代码、controller代码,html头部定义
3.js中获取的话把input type设置为hidden,通过js,jq等都可以。(jq最好下载到本地引用,网上连接可能引入不进来)