If I call destroy method of servlet in the user defined constructor,will it be loaded and executed?
Originally posted by karthi keyan:
But the web container does execute the code
Tough in space?, <a href="http://tjws.sf.net" target="_blank" rel="nofollow">Get J2EE servlet container under 150Kbytes here</a><br />Love your iPod and want it anywhere?<a href="http://mediachest.sf.net" target="_blank" rel="nofollow">Check it here.</a><br /><a href="http://7bee.j2ee.us/book/Generics%20in%20JDK%201.5.html" target="_blank" rel="nofollow">Curious about generic in Java?</a><br /><a href="http://7bee.j2ee.us/bee/index-bee.html" target="_blank" rel="nofollow">Hate ant? Use bee.</a><br /><a href="http://7bee.j2ee.us/addressbook/" target="_blank" rel="nofollow">Need contacts anywhere?</a><br /><a href="http://searchdir.sourceforge.net/" target="_blank" rel="nofollow">How to promote your business with a search engine</a>
Called by the servlet container to indicate to a servlet that the servlet is being taken out of service. This method is only called once all threads within the servlet's service method have exited or after a timeout period has passed. After the servlet container calls this method, it will not call the service method again on this servlet.
This method gives the servlet an opportunity to clean up any resources that are being held (for example, memory, file handles, threads) and make sure that any persistent state is synchronized with the servlet's current state in memory.
My point exactly. Since web application code should never construct a servlet, what's the use of defining extra constructors?
but the servlet will not be taken out of service since the method does not then call back to the container, only the other way around.
If I define my own default constructor,will it call Service and other methods(GET/POST)?
I came to know that container will not pose any error and it will execute the destroy method.
Will it destroy the servlet ot take it out of service?
Will it process GET and SET methods?
Originally posted by thomas davis:
William Brogden
If you do not know the answer for the question,let others answer my question.
It's question,not a question about the life cycle of servlet.
There are some guys who sincerely try to help me out in finding out the answer.Do not discourage them.
You did not even understand my question.Whatever you have mentioned in your mail is not useful.
Hello David O'Meara and Pradip Bhat...I appreciate your answers
Could you please answer my following questions?
I came to know that container will not pose any error and it will execute the destroy method.
Will it destroy the servlet ot take it out of service?
Will it process GET and SET methods?
Bosun (SCJP, SCWCD).
So much trouble in the world -- Bob Marley
I would like to take this opportunity to thank William Brogden for his advice.
Please accept my apology for taking things in different perspective which I should not have done.
I respect his knowledge and guidance.
I aslo would like to thank Pradip Bhat,rathi ji and David O'Meara for their prompt response on my queries.
Consider Paul's rocket mass heater. |