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 will two or three servlets interact or communicate with each other?

1445


Explain url encoding in servlet?

1044


How we can create war file in servlet?

1126


What are its drawbacks of cgi?

1118


What are session variable in servlets?

1023


What are the exceptions thrown by servlets? Why?

1165


Which event is fired at the time of project deployment and undeployment?

1318


What is servlet in simple terms?

1016


What is called a session?

1167


What do you mean by deployment descriptor?

1051


What do you mean by interservlet communication?

1064


What do you mean by a filter and how does it work?

946


What is the use of welcome-file-list?

1035


What are the drawbacks of cgi?

1033


What is servlet instance?

1047