Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

Which are servlet lifecycle methods ?

user-image
Question added by Deleted user
Date Posted: 2014/01/20
Wasif Iqbal Shaikh
by Wasif Iqbal Shaikh , IT Consultant , Reach Management Services - Client Emirates NBD

1. init() - called once when the servlet is first created, so its used for one time initializations like db init.

2. service() - this is the method which performs the actual task, internally calls doGet(), doPost(), etc. depending on the request method.

3. destory() - called at the end of the lifecycle of the servlet, to perform tasks like closing db connections.

More Questions Like This

Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.