aspose file tools*
The moose likes Servlets and the fly likes differnece between init(ServletConfig config) and init()? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "differnece between init(ServletConfig config) and init()?" Watch "differnece between init(ServletConfig config) and init()?" New topic
Author

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

Preetham Chandrasekhar
Ranch Hand

Joined: Nov 05, 2003
Posts: 98
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


"In theory, there is no difference between theory and practice. But, in practice, there is."<br /> - Jan L.A. van de Snepscheut
Kaustubh Patil
Ranch Hand

Joined: Aug 13, 2001
Posts: 164
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.


Kaustubh. Mumbai, India.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: differnece between init(ServletConfig config) and init()?