This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi, Please use code tags. A servlet's init(ServletConfig) method is called by the server immediately after the server constructs the servlet's instance. Depending on the server and its configuration, this can be at any of these times:
1.When the server starts 2.When the servlet is first requested, just before the service() method is invoked 3.At the request of the server administrator
In any case, init() is guaranteed to be called before the servlet handles its first request. Where are you trying to find this printed output?
Joined: Sep 08, 2008
It worked but to my surprise, earlier I was deploying that in tomcat 5.15 and it was nor printing statement in init later when i deployed in weblogic 8.1, it did print that statement, dont know why this behavior?
Don't use 'System.out' in webapplications. You should look at using correct logging instead. What you probably saw was that the output stream wasn't being sent where you thought it was. This led you to believing there was an error when there wasn't one.