• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EVAL_BODY_BUFFERED and invoking tag relation

 
nagalatha mitta
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi friends
HFSJ book page 534 says- if i return EVAL_BODY_BUFFERED even though the invoking tag is empty,then container knows that there is no body so it just skips to doEndTag() method.
my dought is what should be the value of <body-content> subelement in TLD in this case?

one more point in same page says-if <body-content>empty</body-content> then you must not return EVAL_BODY_BUFFERED or EVAL_BODY_INCLUDE from doStartTag() method .any suggestions about this .please let me know



thanks in advance
 
Sudarshan Sreenivasan
Ranch Hand
Posts: 188
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

For you first dout
even though the invoking tag is empty
ideally speaking in this case your <body-content> should be empty and you should not return EVAL_BODY_BUFFERED ... rather return BODY_SKIP.

However if you decide that you have an affection for EVAL_BODY_BUFFERED then you can have your <body-content> as any of the following jsp,tagdependent,scriptless.

But you cannot have it as empty & then return EVAL_BODY_BUFFERED.


Now for the second dout
<body-content>empty</body-content> then you must not return EVAL_BODY_BUFFERED or EVAL_BODY_INCLUDE from doStartTag() method


This is a little obvious .... if <body-content> is empty why are you trying to evaluate it ???

I hope this is usefull !!!

If anyone thinks there are corrections needed in the explanation .. please post them . !!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic