String ProjectPath = new DefaultResourceLoader() .getResource("/").getFile().getAbsolutePath(); ProjectPath = ProjectPath.substring(0,ProjectPath.length()-15);
这个方法是在没有request的情况下获取工程路径,这里需要截取字符串获取根目录“webapp”。
String ProjectPath = new DefaultResourceLoader() .getResource("/").getFile().getAbsolutePath(); ProjectPath = ProjectPath.substring(0,ProjectPath.length()-15);
这个方法是在没有request的情况下获取工程路径,这里需要截取字符串获取根目录“webapp”。