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

1 URL url = ServletContextDemo3.class.getClassLoader().getResource("config.properties");
2         System.out.println(url.getPath());
3         
原文地址:https://www.cnblogs.com/pxffly/p/7466501.html