You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by John Gentilin <jo...@eyecatching.com> on 2001/04/20 23:22:48 UTC

Help with Servlet Configuration Files, where to put them

Is there any standard on how to implement configuration files.

I have an issue with site specific information. If I package the file
with my WAR file and load it from the classpath, I have a catch
22 situation. If I drop the war file in, I can't edit the site specific
configuration until the app is first accessed and expanded into
the webapps dir.

I am interested in how anyone has tackled this problem.

Regards
John G



Clarification, Private config files and not Tomcat config

Posted by John Gentilin <jo...@eyecatching.com>.
Just to clarify,  I am talking about Property files that I want to load
into my servlet.

John Gentilin wrote:

> Is there any standard on how to implement configuration files.
>
> I have an issue with site specific information. If I package the file
> with my WAR file and load it from the classpath, I have a catch
> 22 situation. If I drop the war file in, I can't edit the site specific
> configuration until the app is first accessed and expanded into
> the webapps dir.
>
> I am interested in how anyone has tackled this problem.
>
> Regards
> John G


RE: Help with Servlet Configuration Files, where to put them

Posted by Filip Hanik <ma...@filip.net>.
put it in your warfile in WEB-INF/classes
then load it using
Thread.currentThread().getContextClassLoader().getResourceAsStream()

> If I drop the war file in, I can't edit the site specific
> configuration until the app is first accessed and expanded into
> the webapps dir.

two options

1. create a installation package - ZeroG or Install Anywhere, or something,
that generates the property file based on the users input and then spit out
the complete WAR file with the new property file

2. just tell your customer to extract the war file into the servlet engine
and manually edit the file prior to using it



~
Namaste - I bow to the divine in you
~
Filip Hanik
Software Architect
filip@filip.net
www.filip.net

> -----Original Message-----
> From: gentijo@earthlink.net [mailto:gentijo@earthlink.net]On Behalf Of
> John Gentilin
> Sent: Friday, April 20, 2001 2:23 PM
> To: Tomcat User List
> Subject: Help with Servlet Configuration Files, where to put them
>
>
> Is there any standard on how to implement configuration files.
>
> I have an issue with site specific information. If I package the file
> with my WAR file and load it from the classpath, I have a catch
> 22 situation.
>
> I am interested in how anyone has tackled this problem.
>
> Regards
> John G
>
>
>