File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes BodyTagSupport Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "BodyTagSupport" Watch "BodyTagSupport" New topic


shanthisri mocherla
Ranch Hand

Joined: Sep 05, 2005
Posts: 119
Hi friends

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.

What are the correct options.

[ February 16, 2006: Message edited by: shanthisri mocherla ]
P Chittaranjan
Ranch Hand

Joined: Feb 09, 2006
Posts: 47
Hi Santhi,

First thing here is the execution of the body of the tag depends on the setting in web.xml.
or <body-content>JSP</body-content>
or <body-content>tagdepenent</body-content>

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.

So, I think the last one is the answere.


Thanks,<br />Chittaranjan<br />SCJP 5.0,SCWCD1.4,SCBCD 5
shanthisri mocherla
Ranch Hand

Joined: Sep 05, 2005
Posts: 119
Chittaranjan for your explantion.
thanks Shanthi
I agree. Here's the link:
subject: BodyTagSupport
jQuery in Action, 3rd edition