Multiple choice technology programming languages

Which of the following statements PageConext methods pushBody and popBody are true?

  1. 1) pushBody is called by the jsp container after doStartTag and before doAfterBdy

  2. 2) pushBody is called by the jsp container before doInitBody

  3. 3) popBody is called by the jsp container after doAfterBody and before doEndTag

  4. 4) popBody is called by the jsp container after doEndTag

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

In JSP custom tags with body content, the JSP container manages out/out nesting using pushBody() and popBody(). pushBody() is called after doStartTag() and before doInitBody/doAfterBody to save the current out. popBody() is called after doAfterBody() and before doEndTag to restore the previous out. Options A and C correctly describe this lifecycle. The timing in options B and D is incorrect.