• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EPractice Lab review quiz 1 : SKIP_BODY and EVAL_BODY_INCLUDE when body-content is empty.

 
Himai Minh
Ranch Hand
Posts: 1360
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The tag library descriptor file for a custom tag declares the as "empty". Which of the following is the valid return value of doStartTag() method for this tag?
a. SKIP_BODY
b. EVAL_BODY_INCLUDE
c. SKIP_PAGE
d. EVAL_PAGE
Given answer: a SKIP_BODY

But when I tried, it works for both SKIP_BODY and EVAL_BODY_INCLUDE.


index.jsp


 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2533
113
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The correct answer is SKIP_BODY.

EVAL_BODY_INCLUDE is not conform the JSP specifications:
Empty and Non-Empty Action
If the TagLibraryDescriptor file indicates that the action must always have an empty action, by an <body-content> entry of “empty”, then the doStartTag() method must return SKIP_BODY. Otherwise, the doStartTag() method may return SKIP_BODY or EVAL_BODY_INCLUDE.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic