11智能在线
新记
java中在tomcat获取绝对路径的问题。。。。。。。。急啊。。。。
用java代码如何获取到tomcat的安装路径呢?
可以同时在windows和linux下执行的代码。
举报该文章
相关建议 2012-04-05
System.out.println(new File(System.getProperty("user.dir")));System.out.println(new File(System.getProperty("catalina.home")));
温馨提示:内容为网友见解,仅供参考
当前网址:
https://11.t2y.org/zz/sqvq88q82.html
其他看法
第1个回答 2012-04-12
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
第2个回答 2012-04-05
楼上是在网上粘的
相似回答
大家正在搜
相关问题
在java程序中获得Tomcat下的webapps绝对路径的...
如何通过Java代码获取tomcat服务器的绝对路径
java中怎么获得tomcat路径
如何通过Java代码获取tomcat服务器的绝对路
Java怎样获取一个文件的绝对路径
javaweb中怎么获取文件的绝对路径
tomcat 找文件的路径问题,我很困惑啊
tomcat web项目中怎样请求绝对路径?