I always put my properties's file inside my classpath (under WEB-INF) so I never 
have problems retrieving it. I always use a ResourceBundle:

ResourceBundle bundle = ResourceBundle.getBundle("<path to your configuration 
file>.<filename>");
host = bundle.getString("<key>");

08/02/2002 16:21:33, Chris Pratt <[EMAIL PROTECTED]> wrote:

>In a servlet I always make one of the Initialization Parameters
>(ServletConfig.getInitParameter("properties")) point to my properties
>directory.  If you're writing an application, a command line parameter works
>nicely.
>    (*Chris*)
>
>----- Original Message -----
>From: "Tony Keshikku" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Thursday, February 07, 2002 5:39 PM
>Subject: [JSP-INTEREST] What's the best way to access my resources ???
>
>
>Hi there,
>I'm currently working on JSP,  one of my JSPs get POP3 username and password
>from
>my resources(let's say username and password of POP3 is in the file
>/home/user1/pop3.properties) and use those info to retrieve emails from
>the POP3...
>
>Why I put information of POP3 in properties file is of course that I can
>change the
>information without recompiling.
>But I got problems on "/home/usr1/pop3.properties". That was literal...
>I put the whole PATH in the code and compiled !!
>Now I'm moving to new server, and unfortunately my home directry is changed
>...gotta change the PATH info and recompile.
>So I wanna know for my future, In this case, How should've I set PATH in the
>code
>that easily modified even though my environment is changed.
>
>Thank you
>tony
>
>=========================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
>JSP-INTEREST".
>For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
>DIGEST".
>Some relevant FAQs on JSP/Servlets can be found at:
>
> http://archives.java.sun.com/jsp-interest.html
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.jsp
> http://www.jguru.com/faq/index.jsp
> http://www.jspinsider.com
>
>
>_________________________________________________________
>Do You Yahoo!?
>Get your free @yahoo.com address at http://mail.yahoo.com
>
>
>===========================================================================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
>For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
>Some relevant FAQs on JSP/Servlets can be found at:
>
> http://archives.java.sun.com/jsp-interest.html
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.jsp
> http://www.jguru.com/faq/index.jsp
> http://www.jspinsider.com
>
__________________________________________
"It can only be attributed to human error"
2001 A Space Odyssey

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to