Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

GenericServlet Question

 
Terry McKee
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
getServletConfig().getInitParameter("parm1");
this.getInitParameter("parm1");
What do you think?
 
John Mathew
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no difference between the two methods. It is always convinient to use the getInitParameter() and getInitPArameterNames() defined in javax.serrvlet.GenericServlet
Thanks
Rajeev
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic