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 Client-Server Computing?

2355


How to handle exceptions thrown by application with another servlet?

1038


How do you define a servlet?

939


Why servlet is faster than jsp?

1013


What is load-on-startup in servlet?

1073


What is difference between ServletResponse sendRedirect() and RequestDispatcher forward() method?

1044


Can a jsp be called using a servlet?

1078


What's the architecture of a servlet package?

986


Explain the difference between servlet and cgi?

1108


Which java application server is the best?

982


What are the differences between forward() method and sendredirect() methods?

973


Can you send an authentication error from a servlet?

928


What is SingleThreadModel interface?

1092


What do you mean by session tracking and also explain its techniques?

903


Explain the different ways for servlet authentication?

1033