What is the difference between jsp and servlet life cycles?

Showing Answers 1 - 9 of 9 Answers

Neha

  • Nov 18th, 2007
 

Servlet's life cycle start with the following steps.
servet's object is created
servlets init() method is there where the servlet is initialized it needs arguments Servlet Config's object
Servlets service() method where all work is done then
servlet's destroy() method that's the end of servlet.


where as in jsp's life cycle first .jsp is converted to .class that is servlet and then follow the same step's of servlet...that means after jsp in translated to servlet it behave in the same way as servlet.

Amendment to the Neha's Answer:


Jsp's are never converted to the .java source code until the first request asks it. On ther hands you can pre initiate the servlets

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions