This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Your question is not complete. Are you invoking the Tag with Empty Body ?
If that is the case then if you return EVAL_BODY_BUFFERED, the methods setBodyContent() and doInitBody() will not be called when the tag invoking the handler is empty. i.e if the body is empty it will directly go to the doEndTag().
If the tag invoking the handler is not empty and you are returning EVAL_BODY_BUFFERED, then we can be sure that in the TLD we don't have So the doAftetBody() has to be called.
the tag is invoked with a body content and the TLD does not have empty for <body-content/> tag. Now what will happen? a) Will the body be evaluated? b) If its evaluated will the result be buffered in some writer object? c) Will the result be shown in the browser? d)Will doAfterBody() be invoked? Please clarify.
a) Will the body be evaluated? Yes it will be evaluated.
b) If its evaluated will the result be buffered in some writer object? setBodyContent is called by the container, so the body can be retrieved using getBodyContent. A BodyContent instance is passed to setBodyContent. BodyContent is a Writer which contains the result of the evaluation.
c) Will the result be shown in the browser? No, you have to output the body yourself.