jsp文件绝对路径的设置方法
更新时间:2014年03月22日 17:07:05 作者:
这篇文章主要介绍了jsp文件绝对路径的设置方法,需要的朋友可以参考下
复制代码 代码如下:
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";//返回形式http://localhost:8080/upload/
>
调用:
复制代码 代码如下:
<%=basePath%>
在js代码里也可以直接用
相关文章
SSH整合中 hibernate托管给Spring得到SessionFactory
Spring文件中的 SessionFactory中 加入为了能得到同一个Session2009-06-06
最新评论