Register now or log in to join your professional community.
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.