日期:2014-05-17 浏览次数:20926 次
//比如地址为:http://localhost:8080/project/index.jsp String uri = request.getRequestURI();获取//http://localhost:8080/project/index.jsp String contextPath = request.getContextPath();//获取出http://localhost:8080/project String actionPath = uri.substring(contextPath.length());// 获取/index.jsp String ac = actionPath.substring(1,actionPath.lastIndexOf("."));//获取出index
------解决方案--------------------
lz具体描述一下你的需求 !!!!
------解决方案--------------------
就是请求xx.action,然后浏览器的url是....xx.action?你要这个??
------解决方案--------------------
<% 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+"/";
%>
------解决方案--------------------