Click to See Complete Forum and Search --> : servlets


February 27th, 2000, 10:11 PM
i just wanted to know what is the difference between initialization parameters, and the parameters we send in an shtml file using servlet tags. what is the significance of initialization parameters?? and when do we use getInitParameters() and getParameters(). waiting for u r reply

Jan Meeuwesen
February 28th, 2000, 02:02 AM
Hi there,

when you call your servlet from a HTML form, and you have a textfield on the form, then the value of this textfield is send as an parameter to the servlet. You can get it with getParameter(pname).
And with getInitParameter(), you can get parameters from a file called servlet.properties. This file can be in your default servlet directory. More information on this can be found at:
http://www.java.sun.com/docs/books/tutorial/servlets/index.html

Greets,
Jan Meeuwesen
( If this answer is of any value to you, rate it! (bottom right in your browser under this text) )