1.发布到tomcat后获取应用的根目录

 

 ServletContext s1=this.getServletContext();

String temp=s1.getRealPath("/");//C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\demo1\
String temp=s1.getRealPath("/WEB-INF/classes/log4j.properties"); //C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\demo1\WEB-INF\classes\log4j.properties

相关文章:

  • 2022-12-23
  • 2021-11-19
  • 2021-08-18
  • 2021-12-06
  • 2022-12-23
  • 2022-12-23
  • 2021-07-05
  • 2021-12-02
猜你喜欢
  • 2022-12-23
  • 2021-06-10
  • 2021-08-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案