首页 > Web开发 > 详细

市委组织部项目--js调用后台方法(二)

时间:2014-03-10 20:14:57      阅读:426      评论:0      收藏:0      [点我收藏+]

html中获取工程路径:

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

javaScript中获取工程路径

  var localObj = window.location;
  var contextPath = localObj.pathname.split("/")[1];
  var basePath = localObj.protocol+"//"+localObj.host+"/"+contextPath;

java中获取工程路径

String path = ServletActionContext.getRequest().getRealPath(relativePath); 


市委组织部项目--js调用后台方法(二),布布扣,bubuko.com

市委组织部项目--js调用后台方法(二)

原文:http://blog.csdn.net/hejingyuan6/article/details/20572339

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!