Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EVAL_BODY_INCLUDE Question

 
Ganeshji Marwaha
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am a newbie around here... I had a question from a HFS Mock exam question.

In a question related to Tagsupport, the code snippet is forced to return a "EVAL_BODY_INCLUDE" from a TagHandler that extends TagSupport. But in the TLD File, the "<body-content>empty</body-content>" is set to empty. So, what happens if this piece of code runs...

does it just complete the doStartTag() and followup to doEndTag() method or, does it throw an exception because the BODY-CONTENT is explicitly set to empty.

Thanks for ur help in advance
 
Prasad Pusapati
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ashok,
From HF S& J What I Came To Know Is : tag Body Gets Evaluated If
1)Tag Body Type Is NOT empty In TLD.
AND.
2)Tag Contains The BODY.
AND.
3)doStartTag() Returns EVAL_BODY_INCLUDE.
If The Above 4 Rules Satisfied Then Only Tag BODY Gets Evaluated .Otherwise NO.I Think Exception Will Be Thrown.
 
Ganeshji Marwaha
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Prasad,
I also was able to infer the same from the HFS, but it seems to be the otherway round, based on the answers given in the HFS mock exam. It seems that, though an EVAL_BODY_INCLUDE is returned(which is not legal), the container does not throw an exception. Rather it skips directly to the doEndTag()... Is this behavior expected, or am i missing something...

Thanks for all ur help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic