RE: JSP on Tomcat: application scope variable

2006-03-06 Thread Tim Lucia
Subject: RE: JSP on Tomcat: application scope variable Thanks. I used a singleton class and initialized it from an impl of ServletContextListener. If I place a properties file in WEB-INF/classes of my webapp, I am unable to read it from my class: FileNotFoundException. (Absolute path works fine

Re: JSP on Tomcat: application scope variable

2006-03-06 Thread Martin Gainty
Good Morning Rahul- typically the properties file is located on your classpath Anyone else? Martin- - Original Message - From: "Rahul" <[EMAIL PROTECTED]> To: "Tomcat Users List" Sent: Sunday, March 05, 2006 3:42 PM Subject: RE: JSP on Tomcat: application s

Re: JSP on Tomcat: application scope variable

2006-03-05 Thread Mark Thomas
Rahul wrote: > //properties file in classes/com/example/test > myProps.load(new > FileInputStream("com/example/test/test.properties")); > > Is this not the correct way to specify the path? Try using getResourceAsStream() Mark ---

RE: JSP on Tomcat: application scope variable

2006-03-05 Thread Rahul
Thanks. I used a singleton class and initialized it from an impl of ServletContextListener. If I place a properties file in WEB-INF/classes of my webapp, I am unable to read it from my class: FileNotFoundException. (Absolute path works fine though.) I have: //properties file in classes myPro

RE: JSP on Tomcat: application scope variable

2006-03-05 Thread Tim Lucia
Since they are in application scope, you can make them part of a Singleton pattern, i.e., make them static values of a class, loaded by the contextInitialized() method. They could be properties of the listener itself, or to be more properly factored, you can place them in their own class. Tim -