Try setting a parameter in your web.xml to the value of an external location for your config file. Inside your init() method check this location first for the config file you want to load, if you find it load it and move on, else load the config file you distributed with your application. Hope this helps.
Jeremy Joslin Software Engineer Spotlife Inc. > -----Original Message----- > From: Bryan P. Glennon [mailto:[EMAIL PROTECTED]] > Sent: Monday, April 08, 2002 3:24 PM > To: [EMAIL PROTECTED] > Subject: War files and config info > > > Hi - > We have a web app that gets distributed in a war file to > a tomcat 4.0x server. One of the things in the war file is a > configuration file for the app. This is an XML file that we > open as a resource (using > getResourceAsStream()) in our main servlet init() method. So > far, so good. But, we need a way to override this file so > that we can make config changes without redistributing the > entire application. If we don't use a war file, we can just > put the override file (using the same > name) in a directory that is earlier in the class path. But > we would like to keep the war file, since it does make > distribution a bit easier. > > Any ideas on how to make this work? > > FYI, the exact call we use to open the config file is > InputStream in = > this.getClass().getClassLoader().getResourceAsStream(configFile); > > TIA, > Bryan > > -- > To unsubscribe: <mailto:[EMAIL PROTECTED]> > For additional commands: <mailto:[EMAIL PROTECTED]> > Troubles with the list: <mailto:[EMAIL PROTECTED]> > -- To unsubscribe: <mailto:[EMAIL PROTECTED]> For additional commands: <mailto:[EMAIL PROTECTED]> Troubles with the list: <mailto:[EMAIL PROTECTED]>
