草庐IT

strsproperties

全部标签

java - 如何使用java从linux环境中获取tomcat中当前目录的相对路径

我想用来从我的网络应用程序外部读取属性文件。我在Windows环境的tomcat中部署了一个war文件,我可以使用以下代码从我的Web应用程序外部读取属性文件。//(Method1.)StringfilePath=newjava.io.File(".").getCanonicalPath()+"/webapps/strsproperties/strs.properties";//or//(Method2.)StringfilePath=newFile(System.getProperty("catalina.base"))+"/webapps/strsproperties/strs.p

java - 如何使用java从linux环境中获取tomcat中当前目录的相对路径

我想用来从我的网络应用程序外部读取属性文件。我在Windows环境的tomcat中部署了一个war文件,我可以使用以下代码从我的Web应用程序外部读取属性文件。//(Method1.)StringfilePath=newjava.io.File(".").getCanonicalPath()+"/webapps/strsproperties/strs.properties";//or//(Method2.)StringfilePath=newFile(System.getProperty("catalina.base"))+"/webapps/strsproperties/strs.p