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 printwriter is different from servletoutputstream?

951


What is servlet in simple terms?

970


What do you mean by url pattern in servlet?

1068


Why is httpservlet declared abstract?

1058


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

974


What is the life-cycle of servlets?

1086


What is generic servlet class?

1007


What is the servlet?

1041


What are the differences between the servletconfig interface and the servletcontext interface?

1107


What is the life cycle of a servlet?

1423


Is servlet a server side scripting language?

1061


What do you mean by mime type?

923


Explain servlet life cycle?

1062


What are the different session tracking techniques?

1142


How to get the IP address of client in servlet?

1026