Loading

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>

posted @ 2022-06-22 03:42  Roc-xb  阅读(104)  评论(0)    收藏  举报

易微帮源码


易微帮官网