• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic