Probably the best way is to use the Initialization Parameters feature that
Servlets provide. You'll have to look up how to specify the Initialization
Parameters in your web server, on JWS, it's the second page of the Servlet
Admin form. Then in the servlet's init() method you can use
config.getInitParameter("inifile") to retrieve the parameter. If you need
to retrieve the parameter when you're not in the init() method, use
getServletConfig().getInitParameter("inifile").
(*Chris*)
----- Original Message -----
From: Jaman Burton <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 12, 1999 12:53 PM
Subject: Passing ini type files to a servlet...
> Does anyone know how I can pass a .ini file to a servlet when it is
> being loaded or registered without hard-coding the name of the .ini
> file in the servlet code?
>
> I would like to do something like the equivalent of this:
>
> >fooServlet foo.ini
>
> The obvious problem is that you don't initiate servlets from the
> command line that way. I have my serlvet registered in a weblogic
> properties file but I haven't seen in documentation on how to pass
> arguments to the server through registration...
>
> Currently, I have the .ini file path hardcoded in my servlet source
> code. This becomes a big pain when moving from test box to a
> production environment...
>
> Any ideas?
>
> Jaman Burton
>
> [EMAIL PROTECTED]
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html