Nothing is printing why? I thought of printing "This is doPost!". But I am comment the service(), then it is printing as I expected. My Doubts are: 1. Why when I override all service(), doPost() and doGet(), eventhough the form action is post is not landing in doPost() 2. Suppose If I am commenting the doPost() and doGet() and form's action is Post/Get, then it should land on service(), but it's not landing why? 3. What will be happen if the service() is calling the destory()? [ January 23, 2007: Message edited by: Micheal John ]
SCJP 1.4 (86%), SCWCD 1.4 (86%), SCBCD 1.3 (85%), SCDJWS (Just Started...) - Satisfaction Lies in Our EFFORT, Not in the ATTAINMENT
You are right. If you override service(), then you must specify which method to transfer control to. Remember that every thread starts with service(). However if you don't override service(), then the one in HttpServlet runs and since you have overridden the doPost(), it runs for the servlet class that you write.
You should never need to override the service method, and you absolutely, positively, should not call the destroy (or init) method. Read through the javadocs for these methods for some more information.