• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

When is doAfterBody called?

 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

In which of the following cases will the method doAfterBody() of a tag handler be invoked?


Select 1 correct option.
In which of the following cases will the method doAfterBody() of a tag handler be invoked?

a: This method will always be called when the body of the tag is not empty.

b: This method will be called only when the body of the tag IS empty.

c: This method will be called only when doStartTag() returns Tag.EVAL_BODY_INCLUDE or BodyTag.EVAL_BODY_BUFFERED.

d: This method will be called only when doEndTag() returns Tag.EVAL_BODY_INCLUDE or BodyTag.EVAL_BODY_BUFFERED.


e: This method will be called if doAfterBody() returns IterationTag.EVAL_BODY_AGAIN.



It says correct answer is [e].
I disagree with this, I chose [c].

The description of the question advocates about option [e] only.

[Source]: Enthuware exam2

Thanks,

[ August 12, 2007: Message edited by: Chandra Bhatt ]
[ August 12, 2007: Message edited by: Chandra Bhatt ]
 
Srinivasan thoyyeti
Ranch Hand
Posts: 558
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Chadra,

The author is very particular about "only"

c: This method will be called only when doStartTag() returns Tag.EVAL_BODY_INCLUDE or BodyTag.EVAL_BODY_BUFFERED.

in option e, he didn't specify "only".

What so you say.
 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Shrini!

So tricky!
I will come with their explanation. But I think you are right, this
only is so killing.

Thanks,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic