获取服务器端的webapps路径
2015-05-26 20:22
495 查看
/** * 获取服务器端的webapps路径 * @return */ public String findServerPath(){ String classPath = this.getClass().getClassLoader().getResource("/").getPath(); try { classPath =URLDecoder.decode(classPath, "gb2312"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } String[] strPath = classPath.split("/"); String path = ""; for(int i = 0;i < strPath.length ; i++){ if(i > 0 && i <= 3){ path = path + strPath[i]+"/"; } } return path; }
相关文章推荐
- java 获取服务器端的webapps路径
- java 获取服务器端的webapps路径
- 10.获取客户端指定路径下的文件目录,并传输至服务器端--客户端
- 客户端和服务器端路径问题及资源的获取
- 10.获取客户端指定路径下的文件目录,并传输至服务器端--服务器端
- dnn 模块 获取服务器端路径、获取用户ID、需要登陆才能访问的页面的处理
- 【web】之获取服务器tomcat下webapps目录路径
- java web获取上传的文件在服务器端的路径
- 获取 项目所在的tomcat下的webapps 绝对路径
- .net获取服务器端路径
- java 获取当前类所在项目的Tomcat/Resin 的webapps路径
- Java上传图片到服务器路径获取系列之--图片保存到Tomcat的webapps目录下
- java 获取tomcat webapps目录路径
- 获取服务器端绝对路径
- Java中获取文件路径
- C#获取当前应用程序所在路径及环境变量
- android拍照后图片路径的获取(解决不同手机存在拍照后旋转的问题)
- JS获取当前网址,JS获取当前域名URL ,JS获取网站完整路径页面地址
- js如何获取file控件的完整路径具体实现代码
- Android 获取内置储存卡/外置储存卡(SD CARD)路径的方法