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

What is servletconfig?

1035


Explain the difference between generic servlet and http servlet?

999


What are the two important api's in for servlets?

1089


When servlet object is created?

1163


What is Request Dispatcher?

1439


When a client request is sent to the servlet container, how does the container choose which servlet to invoke?

1029


What are different Authentication options available in Servlets.

1072


Which http method is said to be non-idempotent and idempotent?

1052


How can an existing session be invalidated?

1173


How do you communicate in between Applets and Servlets?

1068


What are the uses of servlet and what is servlet chaining?

1095


What is the difference between the http servlet and generic servlet?

1147


What is servlet used for?

1148


What is the use of servlet context?

1045


Explain the steps involved in placing a servlet within a package?

1059