【发布时间】:2013-02-11 10:16:59
【问题描述】:
假设
URL:http:/localhost:9090/project1/url.jsp?id1=one&id2=two&id3=three
<%
String str=request.getRequestURL()+"?"+request.getQueryString();
System.out.println(str);
%>
有了这个我得到输出 http://localhost:9090/project1/url.jsp?id1=one
但是有了这个我只能检索第一个参数(即 id1=one)而不是其他参数
但如果我使用 javascript,我可以检索所有参数
function a()
{
$('.result').html('current url is : '+window.location.href );
}
html:
<div class="result"></div>
我想检索当前 URL 值以在我的下一页中使用,但我不想使用会话
使用以上两种方法如何检索jsp中的所有参数?
提前致谢
【问题讨论】:
标签: javascript jsp url uri