Forums Register Login

Question and answer from j2eecertificate.

+Pie Number of slices to send: Send
Hi folks

i am just wondering whether answer 2 should also be correct (as well as answer 4)

Thanks very much
JJ

Which of the following statements are true when the doStartTag() method is invoked? Consider that the start of the tag has been reached.


public class ForumTagHandler extends TagSupport { private int totalTopics = 0; public int doStartTag() throws JspException { if (totalTopics > 40) return EVAL_BODY_AGAIN; else return SKIP_BODY; }}

1 The body of the tag is evaluated again.
2 The body of the tag is skipped.
3 SKIP_BODY is not a valid return code.
4 EVAL_BODY_AGAIN is not a valid return code.
5 JspException is not handled in the doStartTag() method.
+Pie Number of slices to send: Send
How do u feel 2 is correct?

whether to evaluate the body or not is decided by the return type. If that is conditional, we cannot say that the body will get evaluated for sure.

Regards,
Leena
And then the entire population worshiped me like unto a god. Well, me and this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 771 times.
Similar Threads
behaviour of doStartTag of TagSupport
Question 19 of HFSJ Final mocktest
Tag Handler - how to capture body of a tag???
j2eeCertificate(custom tag ) ques
doStartTag() retun Type
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 04:13:14.