AFAIK these files are usually put in the WEB-INF directory. The problem may be
that it cannot resolve the absolute path to the file. Define the properties file
as something like "WEB-INF/demo.config" & use getRealPath(String) ...
/** Load the System Properties. */
Properties p = new Properties(System.getProperties());
String propertyFileName = "WEB-INF/demo.config";
/** getRealPath will return the full OS path to your file **/
FileInputStream propertyFile = new FileInputStream(
getServletContext().getRealPath(propertyFileName));
p.load(propertyFile);
System.setProperties(p);
Hope this helps,
Stephen
Kunal Shah wrote:
>
> hi all
> In our application, we are using servlets, pure java classes for database
> manipulations, and jsps .
> In servlets and java classes we are using java resource bundle utility with
> resource files which are used in some jsps also
> In jswdk we put this property files in jsp folder where my all I put all my
> jsp.
> Now we want to move to tomcat, but in tomcat event though I placed the
> property file in my jsp folder with all my jsp files, it throws exception of
> property file not found .
> Where should I place my property file ?
> Thanx in advanced
> Purak
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
--
._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
Stephen Redmond Logica (Mobile Networks)
Tel: +353-1-8193673 5 Custom House Plaza,
Fax: +353-1-8193401 Harbourmaster Place,
mailto:[EMAIL PROTECTED] Dublin 1,
http://www.logica.com/telecoms Ireland.
._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets