This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Rust Web Development and have Bastian Gruber on-line!
See this thread for details.
Win a copy of Rust Web Development this week in the Other Languages forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

EVAL_BODY_INCLUDE Question

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
If you try to please everybody, your progress is limited by the noisiest fool. And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic