Multiple choice technology architecture

What are the life-cycle methods of JSP?

  1. jspInit(), _jspService() & jspDestroy()

  2. init(), service(), destroy()

  3. doPost()

  4. none of the above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

JSP lifecycle methods are jspInit() (called once when JSP is initialized), _jspService() (called for each request, equivalent to service() in servlets), and jspDestroy() (called when JSP is destroyed). Option B lists servlet lifecycle methods. Option C is only one method (doPost is HTTP method handler, not lifecycle).