• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Difference between EVAL_BODY_INCLUDE and EVAL_BODY_BUFFERED

 
Ranch Hand
Posts: 219
Firefox Browser Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ranchers,

What is the difference between EVAL_BODY_INCLUDE and EVAL_BODY_BUFFERED?
From my opinion, EVAL_BODY_INCLUDE is for body-content=empty or tagdependent and EVAL_BODY_BUFFERED is for body-content=JSP. Am I correct?
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
With EVAL_BODY_INCLUDE, you have no chance to work with the body, as it is simply being written to the client.
With EVAL_BODY_BUFFERED, the body is stored in a buffer, which you can decide to output or not, and even change its content.
(imagine a "upper" tag which would change the body's content in uppercase)

Note that if you are using BodyTagSupport, the default return value for doStartTag is EVAL_BODY_BUFFERED.

Details from the spec:
If EVAL_BODY_INCLUDE is returned, and the custom action element is not empty, setBodyContent() is not invoked, doInitBody() is not invoked, the body is evaluated and �passed through� to the current out, doAfterBody() is invoked and then, after zero or more iterations, doEndTag() is invoked. If the custom action element is empty, only doStart() and doEndTag() are invoked.

If EVAL_BODY_BUFFERED is returned, and the custom action element is not empty, setBodyContent() is invoked, doInitBody() is invoked, the body is evaluated, doAfterBody() is invoked, and then, after zero or more iterations, doEndTag() is invoked. If the custom action element is empty, only doStart() and doEndTag() are invoked.
 
Hendy Setyo Mulyo
Ranch Hand
Posts: 219
Firefox Browser Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the explanation, Satou.
I understand now
 
Ranch Hand
Posts: 253
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am need of differences between EVAL_BODY_INCLUDE AND EVAL_BODY_BUFFERED. While exploring java ranch i found this thread. After reading this thread i got a doubt...

If EVAL_BODY_INCLUDE is returned, and the custom action element is not empty



What is custom action element?


Thanks & Regards,
Vipul Kumar.
 
Creator of Enthuware JWS+ V6
Posts: 3411
320
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Vipul Bondugula,

What is custom action element?


What they mean here is that the custom tag (= custom action element) has a body, so like:


Regards,
Frits
 
vipul John
Ranch Hand
Posts: 253
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

What they mean here is that the custom tag (= custom action element) has a body



Thank you Frits...
 
reply
    Bookmark Topic Watch Topic
  • New Topic