thymeleaf如何取url中请求参数值?
需求:例如请求url链接为:http://localhost:8080/community/service?cid=1
如何取到url中的cid参数值呢?
一、HTML取值
<span th:text="${param.cid}"></san>
或者
<span>[[${param.cid}]]</span>
二、 JS取值
<script>
let cid=[[${param.cid}]];
console.log(cid);
</script>

浙公网安备 33010602011771号