通过类加载器在WEB应用中获取资源文件路径

1 URL url = ServletContextDemo3.class.getClassLoader().getResource("config.properties");
2         System.out.println(url.getPath());
3         

 

posted @ 2017-09-02 13:17  狂妄的老头  阅读(474)  评论(0编辑  收藏  举报