thymethymeleaf在url中传递参数的⼏种⽅法1、地址栏中有问号:
单参数:
<a th:href="@{/a(id=${user.userId})}">点击跳转</a>
多参数:
<a th:href="@{/a(id=${user.userId},name=${user.name})}">点击跳转</a>
地址栏中显⽰:
2、RESTFUL风格:
单参数:
<a th:href="@{/{id}(id=${user.userId})}">点击跳转</a>
多参数:
<a th:href="@{/{id}/{name}(id=${user.userId},name=${user.name})}">点击跳转</a>
地址栏中显⽰

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。