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

question no 12 chapter 10 of HSF - already discussed in forum -but not clear

 
sasikumar palakkizhi
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This question has been discussed earlier and I have seen the answers which are available in archives.. The question is


Which is true about the lifecycle of a Simple Tag?
A. The release method is called after the doTag method.
B. The setJspBody method is always called before the doTag method
C. The setParent and setJspContext methods are called
immediately before the tag attributes are set
D. The JspFragment of the tag body is invoked by the Container
before the tag handler's doTag method is called. This value, a
BodyContent object, is passed to the tag handler using the
setJspBody method.



The answer is C and is clear from the archives. It is said in the book that option D is invalid because the fragment is invoked by the doTag implementation, not before the doTag is called.

How the reason for incorrectness stated can be correct. From the life cycle methods of SimpleTag,it is stated that setJspBody is called before the doTag method if the body exists. In my opinion the reason for the incorrectness is associated with the comment on BodyContent object, because the container here produces only a JSPFragment object.

Could anybody help on this question?

Thanks in advance

Sasikumar
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I think it is corrected in Errata of the book. At some time I had corrected it from my book from the errata.

Thanks
 
sasikumar palakkizhi
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply.. I had checked the erratta on the oreilly.com.. But this was not listed... Can u help me by providing the answer?

thanks in advance..

sasi
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic