• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

doAfterBody() Boubt

 
Sandeep Vaid
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
P-553, Q-10
Option E) Assuming no exception occur, doAfterBody() is called after doStartTag() for any tag that implements Iteration tag
and returns EVAL_BODY_INCLUDE from doStartTag().

What if the tag is empty? In this case doAfterBody() is not Invoked. Hence option E) is incorect. Right ?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the body of the tag is declared as empty, doStartTag must return SKIP_BODY, but this mock says that ti returns EVAL_BODY_INCLUDE.
 
Sandeep Vaid
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[QUOTEIf the body of the tag is declared as empty, doStartTag must return SKIP_BODY, but this mock says that ti returns EVAL_BODY_INCLUDE.

What if the body is empty and doStartTag() returns EVAL_BODY_INCLUDE?
Is it going to throw some error ?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The spec is not clear about that, all it says is : If the TagLibraryDescriptor file indicates that the action must always have an empty action, by an <body-content> entry of �empty�, then the doStartTag() method must return SKIP_BODY.. Which does not tell us what will happen if EVAL_BODY_INCLUDE is returned. I would say that it is container dependant.
 
Sandeep Vaid
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the body of the tag is declared as empty, doStartTag must return SKIP_BODY

Where is this information specified in HFSJ ?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The fact that this is written in the specification is not enough ?
 
Shruthi Karthick
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sandeep
refer to HFSJ Pg-534...
 
Sandeep Vaid
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Christophe,
The reason why i always refer to HFSJ is that i want to make sure that every info that is required for the exam is there in the HFSJ. As i will be taking the exam in next few days, i don't have time to refer to Specs...

I totally rely on HFSJ, mock exams and javaranch
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, ok
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic