java Thymeleaf:将参数添加到当前url
我在
http://example.com/some/page?p1=11
我想在当前url中添加一个参数,而不必重新定义它:
http://example.com/some/page?p1=11&p2=32
比如:
<a th:href="@{?(p2=32)}">Click here</a>
但是上面的代码返回http://example.com/some/page?&p2=32
(删除p1
参数)
我如何使用Thymeleaf
# 1 楼答案
基于Raf的answer,我最终得到了这个解决方案: