Return-Path: Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 94534 invoked from network); 27 May 2000 22:51:31 -0000 Received: from pimout7-ext.prodigy.net (HELO pimout7-int.prodigy.net) (207.115.63.106) by locus.apache.org with SMTP; 27 May 2000 22:51:31 -0000 Received: from synera427 (NYCMA010-0791.splitrock.net [209.255.52.29]) by pimout7-int.prodigy.net (8.8.5/8.8.5) with SMTP id SAA08940 for ; Sat, 27 May 2000 18:51:30 -0400 Message-ID: <009f01c205d1$0a652620$1d34ffd1@prodigy.net> From: "ALEXANDROS KOTSIRAS" To: References: <200005262122.OAA06896@moat.nlanr.net> <392EEF6F.1DFFCF77@nlanr.net> Subject: Re: using beans to load properties file Date: Mon, 27 May 2002 18:51:28 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2314.1300 X-Mimeole: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Why don't you use ResourceBundle ? You just place your foo.properties file in any directory that is included in your classpath. I have it in WEB-INF/classes. Then Java will find it without specifying it's exact location. Alex ----- Original Message ----- From: Jason Novotny To: Cc: Sent: Friday, May 26, 2000 5:41 PM Subject: Re: using beans to load properties file > > Thanks Rick, > > I have my web application packaged pretty nicely using the ANT build.xml > stuff, and I want to allow developers to simply deploy my package for their > particular site, changing only the values in "foo.properties". It seems like a > pain in the %$# to have to ask them to modify tomcat.sh (or tomcat.bat on > Windows) accordingly :-( In some sense, it's easier to just say "modify line 32 > of Config.java to reflect the location of foo.properties" and issue "build". > I recall seeing this sort of discussion earlier in the mailing list, and > I'm surprised at how painful this task is. > > Jason > > > Rick Bosch wrote: > > > pass the path in the startup script in the startup script ( ie java > > -Dpropdir=here/are/my/properties org.start.Tomcat ). in a j2ee compliant > > you can pass stuff in server.xml and then get it using jndi , but not > > tomcat. > > > > rick > > > > ---------- > > >From: Jason Novotny > > >To: tomcat-user@jakarta.apache.org > > >Subject: using beans to load properties file > > >Date: Fri, May 26, 2000, 5:13 PM > > > > > > > > > > > I'm trying to stay away from servlets and just use beans and very > > > simple JSP's. I have a bunch of beans that all do different things and > > > make use of a "foo.properties" file for some user configurable settings. > > > I have a ConfigBean that simply loads the properties file and has > > > methods to let the other beans know what the values specified in > > > "foo.properties" are. However, the ConfigBean has to know exactly where > > > the "foo.properties" file is located. I would like some way to specify > > > this (probably in a web.xml or something) and have that accessible to > > > the ConfigBean.... and I really don't want to have to write any JSP like > > > "getServletContext.getInitParameter("foo.properties")"- I'd like that in > > > the Bean somehow. > > > Any ideas? > > > > > > Thanks, Jason > > > > > > > > > -- > > > Jason Novotny novotny@nlanr.net > > > Home: (510) 839-6026 Work: (650) 604-4628 > > > NLANR Applications Support http://dast.nlanr.net > > > > > > > > > > > > > > > -------------------------------------------------------------------------- > > > To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org > > > For additional commmands, email: tomcat-user-help@jakarta.apache.org > > > > -------------------------------------------------------------------------- > > To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org > > For additional commmands, email: tomcat-user-help@jakarta.apache.org > > -- > Jason Novotny novotny@nlanr.net > Home: (510) 839-6026 Work: (650) 604-4628 > NLANR Applications Support http://dast.nlanr.net > > > > > -------------------------------------------------------------------------- > To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org > For additional commmands, email: tomcat-user-help@jakarta.apache.org >