我想在Eclipse中的动态Web项目中使用相对路径。我没有在Servlet中使用它们,而是在Servlet调用的另一个类中使用它们。我试图访问该文件是位于Eclipse中相对路径的问题。
MyProject/WebContent/WEB-INF/propertyFile.properties
属性文件我已经试过几乎所有的相对路径...
WebContent/WEB-INF/propertyFile.properties
/WebContent/WEB-INF/propertyFile.properties
./WebContent/WEB-INF/propertyFile.properties
MyProject/WebContent/WEB-INF/propertyFile.properties
/MyProject/WebContent/WEB-INF/propertyFile.properties
WEB-INF/propertyFile.properties
/WEB-INF/propertyFile.properties
./WEB-INF/propertyFile.properties
...等等...什么我可不可以做?
在此先感谢!
我使用JBoss发布的Web应用程序(我忘了评论)。 – user3640525