Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JavaBeat question, SKIP_BODY

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



Could anybody please focus on this, why the output is Hello?
SOURCE


Thanks,
 
Vassili Vladimir
Ranch Hand
Posts: 1585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

The output is Hello because you did not override the doStartTag() method, which its default return value is SKIP_BODY, so, the body will not be be evaluated.

Best of luck ...
 
Remko Strating
Ranch Hand
Posts: 893
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because MyTag doesn't override the doStartTag() method.

The default behavior of the doStartTag is that there is no body evaluated.

You should add the following code for getting output

 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Vassili & Remko!

I got the that.

You rock dude.


Thanks,
 
Michael Ku
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is always a good idea to set up the code in question and run it to see what is happening and why. You can even step thru the code in debug mode.

I did this when preparing for the exam and I learned so much that the exam was a breeze...
 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with you Michael!

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