Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

differnece between init(ServletConfig config) and init()?

 
Preetham Chandrasekhar
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well im guessing....
in init(ServletConfig config) all the initparameters are the tomcat or the specific server parameters and in this case the web.xml from the conf direcotry is used and when it is init() then we can specify our own initparams acc to the logic of the program and call it from the web-inf/web.xml?
i might be completely wrong....plz correct me if so
Preetham
 
Kaustubh Patil
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hmmm.. intresting..
This init() is just for convinience. If you want to do something in initilization. Then by default you must call super.init().
But if you override init() and write your code in it there is no need to call init(servletConfig).
The GenericServlet.init(config) always calls the init() in the end so your code will get executed.
This is just a matter of convinence. I cannot think of anything else.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic