如题,不是获取请求的地址,request的都不是,我是要获取当前浏览器地址栏的全部字符串,注意不是用js获取。。。。求解啊,网上全部没答案,我就不信csdn没人能帮我解决。谢谢
------解决方案--------------------
http://my.oschina.net/lovedreamland/blog/16161
------解决方案--------------------
当前浏览器地址不是请求地址是什么 楼主举个例子看看
------解决方案--------------------
HttpClient么
------解决方案--------------------
- Java code
//比如地址为:http://localhost:8080/project/index.jspString uri = request.getRequestURI();获取//http://localhost:8080/project/index.jspString contextPath = request.getContextPath();//获取出http://localhost:8080/projectString actionPath = uri.substring(contextPath.length());// 获取/index.jspString ac = actionPath.substring(1,actionPath.lastIndexOf("."));//获取出index
------解决方案--------------------
lz具体描述一下你的需求 !!!!
------解决方案--------------------
就是请求xx.action,然后浏览器的url是....xx.action?你要这个??
------解决方案--------------------
- HTML code
<%String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%>
------解决方案--------------------
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
------解决方案--------------------
------解决方案--------------------