posted 16 years ago
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.