Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

can i call destroy() method in init() method of servlet

Answer Posted / sunil jaiswal

Yes, we can call destroy method from init method without any worry. Destroy method will be called up as calling any other method. Request shall still be process afterwards through service method(doGet, doPost etc). Because calling destroy method doesnt mean the killing the servlet instance. Calling the init, service and destroy method is in the specification of servlet lifecycle. So we can not alter those specification through outside. Once the servlet container thinks the servlet is of no use at some time(at the server shutdown) the container surely will be calling up the destroy method prior to destroy the servlet instance.

Is This Answer Correct ?    10 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How would you create deadlock on your servlet?

1146


Explain servlet events?

956


How we can call a jsp from the servlet?

969


Tell the new features added in servletrequest interface i.e. Servlet 2.4

1137


How to get the actual path of servlet in server?

1189


What are the servlet events?

1021


What do you mean by default initialization in java servlet?

1068


What are the phases of the servlet life cycle?

1077


What is called a session?

1135


What is the main purpose of java servlets?

1021


What is life cycle of Servlet?

1030


What do you understand by mime type?

949


What is servlet name in web xml?

959


What is the capacity the doget can send to the server?

1037


Explain the difference between generic servlet and http servlet?

957