This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Question and answer from j2eecertificate. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Question and answer from j2eecertificate." Watch "Question and answer from j2eecertificate." New topic

Question and answer from j2eecertificate.

Trav Smith

Joined: Sep 24, 2003
Posts: 5
Hi folks

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

Thanks very much

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.
Leena Diwan
Ranch Hand

Joined: Jun 18, 2001
Posts: 351
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.


I agree. Here's the link:
subject: Question and answer from j2eecertificate.
jQuery in Action, 3rd edition