Pierre - Yves

Thanks very much for the reply.This is the code i have used - which to the best of my knowledge should do the same thing as yours:

FileInputStream fileTopics=null;

    try
    {
      // open input stream to topics.properties file
      fileTopics = new FileInputStream(filePath +
        "topics.properties");

      Properties propTopics = new Properties();
      propTopics.load(fileTopics);

//    load properties object 

However after saving the file in the root of my C:\ (where i have tomcat installed i'm still getting FileNOtFoundException. Can you throw any light on the situation for me ??

Kind regards

Elaine

>From: Pierre-Yves Saumont <[EMAIL PROTECTED]>
>Reply-To: "A mailing list for discussion about Sun Microsystem's Java Servlet API Technology." <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Re: properties file in tomcat3.2.1
>Date: Thu, 12 Jul 2001 22:53:42 +0200
>
>Elaine,
>
>here is an example of how to read a property file located in the document
>root directory :
>
> Properties properties = new Properties();
> try {
> FileInputStream propFile = new
>FileInputStream(getServletConfig().getServletContext().getRealPath("/topics.
>properties");
> properties.load(propFile);
> }
> catch (IOException ioe) {
> // whatever you want
> }
>
>Pierre-Yves
>
>
>-----Message d'origine-----
>De : A mailing list for discussion about Sun Microsystem's Java Servlet API
>Technology. [mailto:[EMAIL PROTECTED]]De la part de Elaine Burke
>Envoy� : jeudi 12 juillet 2001 21:00
>� : [EMAIL PROTECTED]
>Objet : properties file in tomcat3.2.1
>
>
>
>Can anyone help.......
>
>I need to create a topics.properties file and save it in the filePath
>directory to run my servlet successfully. Does anybody know where that would
>be in tomcat-3.2.1?? I tried creating it within the localhost8080 folder
>within the work folder but i'm still getting a FileNotFoundException. Any
>suggestions appreciated!
>Thanks
>Elaine B.
>
>
>
>Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
>___________________________________________________________________________
>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
>
>___________________________________________________________________________
>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


Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

___________________________________________________________________________ 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

Reply via email to