Hi Friends......
What is preinitialization of a servlet?
Thanks.......
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Satyapriya NayakPosted Jan 10, 2012, 10:40 PM
Servlets are loaded and initialized at the first request come to the server and stay loaded until server shuts down. However there is another way you can initialized your servlet before any request come for that servlet by saying
Permanent servlet: - Such types of servlet get instantiated on start of the server. The instance of this servlet remains on the server till the server runs. Whenever the server shutdowns then instance of this servlet gets destroyed and before to it destroy () method execute. Life span of servlet is same as the life span of the server. Such type of servlet is independent of users appearance. If any user come to access this servlet then doGet(),doPost() or service() method executes. Such types of servlets can be used to perform task on start of server or on stop of server. The servlet can be created by using generic or http servlet. During deployment of this servlet a tag must be used as
Web.xml settings
Thanks
Vikas MishraPosted Feb 4, 2012, 1:26 AM