This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
What is the benefit of having init(ServletConfig) ? As I know it does an initialization activity. But if i provide constructor for a servlet, still, this method gets called prior to init() then call gets redirected to either doGet or doPost. In this case what is the extra mileage we get after having this init method ? with regards, vikram
The servlet API requires an init method so that the servlet configuration can be passed properly. I suspect that one reason they did it this way is so the Servlet interface can neatly define all of the methods needed. Use of the constructor is under the control of the servlet engine. Don't confuse the operation of the constructor and init with the flow of control during a request. Bill