我在jsp中想得到当前页面的url,因为他是由Struts2的action跳转过来的,地址是http://192.168.2.121:8080/popuEmenu/jsp/zhuye.jsp?gId=2
但是我用<%
String url=request.getScheme()+"://";
url+=request.getHeader("host");
url+=request.getRequestURI();
if(request.getQueryString()!=null)
url+="?"+request.getQueryString();
out.println(url);
%> 只能得到http://192.168.2.121:8080/popuEmenu/jsp/zhuye.jsp?gId=2 ,和我想要的不一样,大家帮帮我研究下
但是我用<%
String url=request.getScheme()+"://";
url+=request.getHeader("host");
url+=request.getRequestURI();
if(request.getQueryString()!=null)
url+="?"+request.getQueryString();
out.println(url);
%> 只能得到http://192.168.2.121:8080/popuEmenu/jsp/zhuye.jsp?gId=2 ,和我想要的不一样,大家帮帮我研究下
第一个url是带action的http://192.168.2.121:8080/popuEmenu/BilloffareAction!clickGreatvariety?gId=2
第二个url是 http://192.168.2.121:8080/popuEmenu/jsp/zhuye.jsp?gId=2