Hello Matt,
Where does class p exist? Is it also in WEB-INF/lib or
WEB-INF/classes?
If so, the only one of your examples that will work is:
p.getClass().getResourceAsStream("/net/props/myProps.properties");
If your properties file is in the same package relative to class "p",
then you can do:
p.getClass().getResourceAsStream("myProps.properties");
You can also do this:
p.getClass().getClassLoader().getResourceAsStream("net/props/myProps.properties");
See this for more info...
http://marc.theaimsgroup.com/?l=tomcat-user&m=103904964313189&w=2
Jake
Thursday, December 12, 2002, 2:39:07 PM, you wrote:
MS> Hello,
MS> I'm trying to access a properties file that's located in a package within a
MS> jar file in /WEB-INF/lib.
MS> net/props/myProps.properties
MS> Properties p = new Properties();
MS> InputStream is = ...
MS> I've tried a lot of methods to set the InputStream, i.e.,
MS> p.getClass().getResourceAsStream("/net/props/myProps.properties");
MS> p.getClass().getResourceAsStream("net/props/myProps.properties");
MS> p.getClass().getResourceAsStream("myProps.properties");
MS> getServletContext().getClass().getClassLoader().getResourceAsStream("/net/pr
MS> ops/myProps.properties");
MS> but I always get null...
MS> Can someone offer a suggestion?
MS> Thanks alot,
MS> Matt
MS> --
MS> To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
MS> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
--
Best regards,
Jacob mailto:[EMAIL PROTECTED]
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>