• 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
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!