/**
* 读取common.properties的路径
*/
public String getProPath(){
String url=this.getClass().getResource("").getPath().replaceAll("%20"," ");
* 读取common.properties的路径
*/
public String getProPath(){
String url=this.getClass().getResource("").getPath().replaceAll("%20"," ");
String path=url.substring(0, url.indexOf("WEB-INF"))+ "WEB-INF/config/common.properties";
return path;}
获取到的路径为:
G:\JavaCode\neweclipse\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\SaaSCourses\WEB-INF\config\common.perproties