If aTag extends BodyTagSupport and returns EVAL_BODY_BUFFERED in the doStartTag() method> What is the output?? 1. BODY CONTENT will be returned in the respnse 2.<%= BODY CONTENT %>is returned . 2. the tags' body content is not returned to the response as it will be buffered.
First thing here is the execution of the body of the tag depends on the setting in web.xml. <tag> <name>aTag</name> <tag-class>sampleLib.aTag</tag-class> <body-content>empty</body-content> or <body-content>JSP</body-content> or <body-content>tagdepenent</body-content>
</tag> 1.If the body content is JSP, the container will evaluate the body to "BODY CONTENT" and add it to the buffer( since you are returning EVAL_BODY_BUFFERED) . This will not be available to the response directly unless you are getting the data from buffer and putting it to the out object. 2. If the body content is tagdepenent.The total expression [<%="BODY CONTENT " %>] will be added to the buffer. you have to get that from the buffer and use in the tag handler calss.
In both of the cases, the data will be there in the buffer.It will not be directly available to the response.
That is only because of the return type EVAL_BODY_BUFFERED.
If the return type is EVAL_BODY_INCLUDE, the body will be directly available to response.