我正在使用Spring MVC。要求某些用户选择保持全局,并始终在url参数中。我也可以用代码随意删除它。跨请求存储url参数
对于Spring MVC,有没有像Persistent Page Data(类似于Tapestry http://tapestry.apache.org/persistent-page-data.html)的东西。
链接到一个类似quesion那解答:http://osdir.com/ml/java.appfuse.user/2005-08/msg00507.html 感谢
更新
最后,我用一个简单的技术,其中: 1.我会捕捉与查询paramters当前网页的网址。 2.将新参数添加或替换到此URL中。
<c:set var="contextPath" value="${pageContext.request.contextPath}"></c:set>
<c:set var="servletPath" value="${requestScope['javax.servlet.forward.servlet_path']}"></c:set>
<c:set var="currentPath" value="${contextPath}${servletPath}"></c:set>
<a href="${fn:replaceUrlParameter(currentPath,'age','1') }">ageone</a>
其中replaceUrlParameter()使用正则表达式替换或添加查询参数。
您应该将其放入用户会话中。 – krock 2012-04-21 08:14:25
我想要url中的参数,以便搜索引擎也可以索引这些页面。 – Rahul 2012-04-21 08:19:48