| [news.eclipse.webtools] Re: Tomcat/Servlet Resource File Location |
Larry Isaacs wrote on Tue, 08 September 2009 10:39Andreas H. wrote: > Hi, > ... > > cheers, > meta
You could try something like the following to get an InputStream to read the properties:
Servlet.getServletConfig().getServletContext().getResourceAs Stream( "/WEB-INF/db.properties")
Error and exception handling to be added.
Cheers, Larry
Hello,
That could be some sort of a icky solution. Sorry I didn't add the following information: I'm calling a backend object that's not a servlet and this object was meant to handle everything, including database connection which i would have needed the properties file for. I don't have a Servlet in there to get the configuration from. Of course I could get the Path in the servlet and try to pass it to the backend, but that's what makes it icky in my opinion. Could there be another way?
Cheers, meta
Cheers, Larry