• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Bartender
Posts: 2418
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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


 
Creator of Enthuware JWS+ V6
Posts: 3411
320
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic