Re: trying to run getResourceAsStream(0 from inside a WAR

Carlos Rodriguez <[email protected]>
Newsgroups gmane.comp.java.sun.servlet
Message-ID <[email protected]>
Hi, thanks to everyone who replied.
 
It turns out that the using the context is the way to go.  Using the Classloader, one can
only go from where the class was loaded, downwards.
 
-carlos rodriguez

-----Original Message-----
From: Mathew Jose Binoi P R [mailto:[email protected]]
Sent: Wednesday, November 19, 2003 10:40 PM
To: [email protected]
Subject: Re: trying to run getResourceAsStream(0 from inside a WAR



Hi, 

Use ServletContext to get the properties file from WEB_INF/properties folder. 

eg:- String logFile = "/WEB-INF/properties/log4j.properties"; 
        InputStream in = getServletContext().getResourceAsStream(logFile); 

Best Regards,
Mathew


___________________________________________________________________________
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.