On Saturday, March 27, 1999 1:52 AM, Damian Fauth
[SMTP:[EMAIL PROTECTED]] wrote:
> John Brecht wrote:
> >
> > I would like to be able to pass a list of parameters of arbitrary size
to a
> > servlet. The syntax for passing parameters via a properties file is:
> >
> > Syntax: servlet.[classname].initArgs=[name]=[value],[name]=[value],...
>
> What I have done in this situation (and I stole the idea from the GSP
> guys) is to supply my servlet with a "propfile" parameter as you
> describe:
>
> servlet.[classname].initArgs=propfile=/path/to/propfile.dat
Just as a small tweak to this. What I tend to do is
to allow both forms of args. I args-parsing codeh
takes a string _either_ of the form
name1=arg1,name2=arg2,name3=arg3...
or
@name
If it encounters the first form it creates a Properties
object and "put"s the names and values.
If it encounters the second form, it loads the Properties
from the specified file or URL.
For me this helps because simple stuff which doesn't need
much configuring (or where the configs hardly ever change)
can be done in line, but more complex or frequently
changing cases can have a properties file.
Just a suggestion,
--
Frank Carver
[ Personal: [EMAIL PROTECTED] http://www.efsol.com/ ]
[ At Work: [EMAIL PROTECTED] tel +44 (0)1473 227371 ]
----------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html/>
Problems?: [EMAIL PROTECTED]