Hi,
I have a config file for a web application - currently the absolute path is
specified in a java class that's method's are read by a servlet to get the
info in the config file - I want to deploy the webapp on a remote server so
I'd like to remove the absolute path to the file but can't seem to
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
, 2008 at 9:47 PM, Caldarale, Charles R
[EMAIL PROTECTED] 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
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
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.
Can
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]
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);
(=
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: