//获取项目的本地路径
         String path = TestCtrl.class.getClassLoader().getResource("/").getPath(); String p = path.replaceAll("WEB-INF/.*", ""); System.out.println(path); System.out.println(p); /**********输出结果 /D:/tomcat-6.0.32/webapps/ROOT/WEB-INF/classes/ /D:/tomcat-6.0.32/webapps/ROOT/ ******/

 

相关文章:

  • 2021-05-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
  • 2021-12-22
猜你喜欢
  • 2021-11-27
  • 2021-09-07
  • 2021-10-28
  • 2022-12-23
  • 2022-12-23
  • 2021-11-05
相关资源
相似解决方案