• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

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

 
Ranch Foreman
Posts: 1897
12
  • 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


 
Creator of Enthuware JWS+ V6
Posts: 3341
303
Android Eclipse IDE Chrome
  • 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.

 
Forget Steve. Look at this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic