RE: where to put config file in a webapp

2008-04-02 Thread Caldarale, Charles R
> From: Kimberly Begley [mailto:[EMAIL PROTECTED] > Subject: where to put config file in a webapp > > Currently it is in WEB-INF Normally, such a properties or config file would be placed in WEB-INF/classes, and accessed via ServletContext.getResourceAsStream(). > I read online that I could put

Re: where to put config file in a webapp

2008-04-02 Thread Kimberly Begley
Great thanks - it's not actually in a servlet - just a java class of methods so I guess I could pull it out of the java class and put it into the servlet that is calling the method - if that makes sense - I was just hoping to avoid that. Thanks for the advice - much appreciated. On Wed, Apr 2, 20

Re: where to put config file in a webapp

2008-04-02 Thread David Smith
Caldarale, Charles R wrote: From: Kimberly Begley [mailto:[EMAIL PROTECTED] Subject: where to put config file in a webapp Currently it is in WEB-INF Normally, such a properties or config file would be placed in WEB-INF/classes, and accessed via ServletContext.getResourceAsStream(). I

RE: where to put config file in a webapp

2008-04-02 Thread Peter Crowther
> From: Kimberly Begley [mailto:[EMAIL PROTECTED] > Great thanks - it's not actually in a servlet - just a java > class of methods > so I guess I could pull it out of the java class and put it > into the servlet > that is calling the method - if that makes sense - I was just > hoping to avoid that.

Re: where to put config file in a webapp

2008-04-02 Thread Kimberly Begley
very cool - yes sorry I never seem to give enough detailed info - thanks for reading my mind! you have my wants described very clearly! I will give it a go - thanks!! On Wed, Apr 2, 2008 at 10:08 PM, Peter Crowther <[EMAIL PROTECTED]> wrote: > > From: Kimberly Begley [mailto:[EMAIL PROTECTED] > >

Re: where to put config file in a webapp

2008-04-02 Thread Ingmar Lötzsch
You also can use ResourceBundle (if you need only Strings) or ListResourceBundle. 1. ResourceBundle Save your configuration in com.x.y.z.MyConfig.properties (or in the default package) In your Java class type ResourceBundle bundle = ResourceBundle.getBundle("com.x.y.z.MyConfig"); (= ResourceBund

Re: where to put config file in a webapp

2008-04-02 Thread Ingmar Lötzsch
I forgot to change line 113: old version Object[][] contents = resources.toArray(new Object[0][0]); new version Object[][] contents = resources.toArray(emptyObjectArray); Ingmar - To start a new topic, e-mail: users@tomcat.apac