This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes GenericServlet Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "GenericServlet Question" Watch "GenericServlet Question" New topic

GenericServlet Question

Terry McKee
Ranch Hand

Joined: Sep 29, 2000
Posts: 173
GenericServlet implements Servlet and ServletConfig. So why do we need to use the method defined in the Servlet interface getServletConfig()? If by default the GenericServlet is implementing the ServletConfig the following should have the same results:
What do you think?
John Mathew

Joined: Jun 06, 2002
Posts: 8
There is no difference between the two methods. It is always convinient to use the getInitParameter() and getInitPArameterNames() defined in javax.serrvlet.GenericServlet
I agree. Here's the link:
subject: GenericServlet Question
Similar Threads
When and why use getServletConfig()???
getServletContext() gives NullPointerException
Why is ServletConfig obj passed to init() of GenericServlet when the class implements the interface?
Why does GenericServlet implement ServletConfig