jar我从我创建了一个Java project并想在JSP Servlet Project. 我正在尝试加载一个属性文件,比如说我JSP Servlet Project保存的sample.propertiesWEB/properties/sample.properties应该由jar.Im 中的一个类读取。我使用下面的代码写在一个 jar 类中来访问它。
Properties prop=new Properties();
prop.load(/WEB-INF/properties/sample.properties);
但每次我得到fileNotFound exception.
请建议我解决方案。
这是结构
WEB-INF
|
lib
|
myproject.jar
|
myclass (This class needs to read sample.properties)
|
properties
|sample.properties