This week's giveaway is in the Java/Jakarta EE forum.
We're giving away four copies of Java EE 8 High Performance and have Romain Manni-Bucau on-line!
See welcome thread
Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Body of tag always written to JSP page?  RSS feed

Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

I'm trying to learn more about tag libraries and creating your own tags. I've tried out the RepeatHelloTag example from this page:

It works fine but I just want to understand How it works:
Is the body content always written to the JSP page when the body is evaluated (even if you haven't written any code)?

It seems to be something like that because when you run the example code the body content is written times, though only the Last call to actually seems to print anything. (The previous calls just increment the counter.)

But how does really work?
Maybe the body content is automatically written to some buffer at each iteration and getPreviousOut prints the whole content of that buffer?
But then if you'd only want to print out the last two iterations (for some reason) that would not be possible, or would it?

It would be nice if someone could shred some light on this issue for me.

Thanks in advance!

Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!