Servlet initialization parameters are kept in the servlets.properties file,
which is part of the servlet engine you are using. With JRun for instance,
it is under ...\JRun\jsm-default\services\jse\properties\ directory.
Here are the sample entries from this file for a simple servlet called
MyServlet in JRun...
servlet.MyServlet.code=MyServlet
servlet.MyServlet.args=name1=value1,name2=value2 // here are the name=value
pairs
servlet.MyServlet.preload=false
You then can reference...
String myInitParam1 = getInitParameter("name1")
...to return the "value1", within the init() method of the servlet.
Hope this clears it up a little
Jason
|-----Original Message-----
|From: A mailing list for discussion about Sun Microsystem's Java Servlet
|API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of
|Xizhen Wang
|Sent: Tuesday, May 02, 2000 9:49 AM
|To: [EMAIL PROTECTED]
|Subject: How to use getInitParameter()?
|
|
|Hi! I am a newbie to Servlet. Can anyone tell me how to use
|getInitParameter()? I think I should put the parameters into a
|configuration file as name/value pairs. Can anyone tell me the details?
|
|Thank you!
|
|
|--
|Xizhen
|
|https://www.alladvantage.com/home.asp?refid=ANI887
|https://secure.paypal.com/refer/pal=delate%40hotmail.com
|
|___________________________________________________________________________
|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