<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
alert("<%=path%>")输出的值是/, 取不到工程名是怎么回事?
百度说是因为工程部署在了根目录,我照网上的方法改了server.xml下的context属性还是没有用
求大神解答啊!!!
request.getContextPath()笔录
<%=request.getContextPath()%>
request.getContextPath()
http://leo1211.iteye.com/blog/518397
http://blog.sina.com.cn/s/blog_6cbe0cff0101j6jl.html
request.getContextPath()得到项目的名字
如果项目为根目录,则得到一个"",即空的字条串,
如果项目为abc, <%=request.getContextPath()% >/ 将得到abc/