J2EE 读取文件路径

    在J2ee中实现java类读取webcontent/web-inf/config.xml的实现代码 ,其中../config.xml相对于classes的路径

            java.net.URL url = this.getClass().getClassLoader().getResource("../config.xml");
            File xmlFile = new File(url.toURI().getPath());    


原文地址:https://www.cnblogs.com/wala-wo/p/5119253.html