遗忘海岸

江湖程序员 -Feiph(LM战士)

导航

Eclipse 整后tomcat的webApps目录

调试时发现不在tomcat的安装目录,

运行下面语句发现,是在eclipse的插件目录的一个web插件目录中

       InputStream in = this.getClass().getClassLoader().getResourceAsStream("conn.properties");
       Properties properties=new Properties();
       properties.load(in);
       in.close();
       System.out.println(properties.getProperty("Driver"));
       String pathString= this.getServletContext().getRealPath("/WEB-INFO/Classes/conn.propertie");
       System.out.println(pathString);
View Code

 

posted on 2013-06-06 07:53  遗忘海岸  阅读(227)  评论(0编辑  收藏  举报