This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes GenericServlet's getInitParameter() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "GenericServlet Watch "GenericServlet New topic

GenericServlet's getInitParameter()

riohk kurn
Ranch Hand

Joined: Oct 19, 2002
Posts: 31
Refer to API, genericServlet has method called getInitParameter(), but what does it refer to? You know, there are two types of init parameter. One from <context-param> and one from <init-param> inside <servlet>.
k space
Ranch Hand

Joined: Jun 25, 2002
Posts: 104
If you read the javadoc carefully (listed below), you should find that it refers to the servlet init parameter, i.e. ServletConfig.
public java.lang.String getInitParameter(java.lang.String name)
Returns a String containing the value of the named initialization parameter, or null if the parameter does not exist. See ServletConfig.getInitParameter(java.lang.String).
This method is supplied for convenience. It gets the value of the named parameter from the servlet's ServletConfig object.

SCEA | SCBCD | SCWCD | SCJP - The kSpace
Maha Annadurai
Ranch Hand

Joined: Oct 27, 2002
Posts: 87
Well, GenericServlet implements the interface 'ServletConfig'. One of this interface methods is getInitParameter(). So it's basically coming from ServletConfig implementation.
I agree. Here's the link:
subject: GenericServlet's getInitParameter()