did u
try calling it with the direcotry structure
com.test.MyProperty.properties
r
sasi
-----Original Message-----why is it tomcat could not locate the property file if i place it on the
From: A mailing list for discussion about Sun Microsystem's Java Servlet API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of randie ursal
Sent: Tuesday, August 27, 2002 5:07 PM
To: [EMAIL PROTECTED]
Subject: Re: setting the classpath variable
package directory structure of my servlets?...it is still on the WEB-INF/classes
directory isnt it? just need some more clarifications.
e.g WEB-INF/classess/com/test/MyProperty.properties
thanks
Cédric Viaud wrote:
Hi, you can also do something like this : Properties prop = new Properties(); prop.load(this.getClass().getResourceAsStream("/MyProperties.properties")); With this syntax you just put the file in the WEB_INF/classes directory and the ClassLoader found it there. Regards, Cédric NB : this exemple comes from another mailing list "Tomcat-users" ----- Original Message ----- From: "Nic Ferrier" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, August 27, 2002 10:32 AM Subject: Re: setting the classpath variablerandie ursal <[EMAIL PROTECTED]> writes:hi, i have this newbie question. here is the scenario, i have a servlet that will read a ".properties" file and i make use of the PropertyResourceBundle class to read the value from the property file. the problem is that the PropertyResourceBundle doesn't find the properties file. the API for ResourceBundle said that my properties file must be set on the classpath. so, how do i set this file so that it will be located by my servlet? i tried placing my properties file on the /lib directory of my web application but it doesn't work...or do i have to explicitly include it on my classpath environment variable?Servlet containers provide protected class paths. You could put your property file in the "WEB-INF/classes" directory of your war file (or directory structure). Nic___________________________________________________________________________To unsubscribe, send email to [EMAIL PROTECTED] and include in thebodyof 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___________________________________________________________________________ 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