aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes EVAL_BODY_BUFFERED Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "EVAL_BODY_BUFFERED" Watch "EVAL_BODY_BUFFERED" New topic
Author

EVAL_BODY_BUFFERED

Deepak Jain
Ranch Hand

Joined: Aug 05, 2006
Posts: 637
1) Classic tag extends BodyTagSupport
2) doStartTag returns EVAL_BODY_BUFFERED

a) Will the body be evaluated? -> I tested this and body was not evaluated.
b) Will doAftetBodyTag() be invoked?
And since the body is never evaluated then doAfterBody() will never be invoked correct?

Please answer both the quesitons.


SCJP, SCWCD, SCBCD
tanveer chowdry
Greenhorn

Joined: Jul 17, 2007
Posts: 21
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.

Correct me if im wrong !


Regards,<br />tanveer<br /> <br />SCJP 1.4 (86%)<br />SCWCD 1.5 (98%)
Deepak Jain
Ranch Hand

Joined: Aug 05, 2006
Posts: 637
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.
Deepak Jain
Ranch Hand

Joined: Aug 05, 2006
Posts: 637
And the question is from Whiz labs series.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

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.

d)Will doAfterBody() be invoked?
Yes.


[My Blog]
All roads lead to JavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EVAL_BODY_BUFFERED
 
Similar Threads
HFSJ : page:553 Q:9
EVAL_BODY_BUFFERED - Yet again
Return value of doAfterBody
One Tag Question
Difference between EVAL_BODY_INCLUDE and EVAL_BODY_BUFFERED