1.) If I were working with a tag that I wanted to manipulate the body content of, I would use the BodyTag Interface and the provided BodyTagSupport. The relevant Constants in the Interface are
BodyTag: EVAL_BODY_BUFFERED (to get hold of the BodyContent object and appropriate JspWriter)
SKIP_BODY (to tell the Jsp Engine ignore the body)
2.) If I were working on a tag that I just wanted the engine to manage the body I would use the Tag Interace and the provided TagSupport. The relevant constants would be
Tag:
EVAL_BODY_INCLUDE (to tell the Jsp Engine include the body)
SKIP_BODY (to tell the Jsp Engine ignore the body)
Now, its not really that logical to me to apply any case where I would want to use BodyTag/BodyTagSupport and use the constant "EVAL_BODY_INCLUDE" when all the functionality for that case is already well defined in the Tag/TagSupport interface, because of this providing EVAL_BODY_INCLUDE in a BodyTag is just confusing the issue, why would you use a BodyTag if you didn't want to get hold of the BodyContent? This is why it seems silly to me. I spent a good amount of time trying to understand my mistake of doing this. Now, if the interface enforced "not" doing this, the problem would have never arisen.
You either want the Body or you don't, the nature of how the body is processed should be the buisness of the Interface/Implementation (Tag or BodyTag). I think exposing an alternate EVAL_BODY_INCLUDE/BUFFERED optionality breaks that Interface functionality encapsulation. Because now you have BodyTags doing what Tags was supposed to do in the long run.
Of course, I could be completely missing something here, which I'm sure our peers will gladly stand up and point out (and which I will take pleasure in finding out about).
Cheers (and Happy Holidays),
-Mark
Karr, David wrote:
The return value from "doStartTag()" can have three (more?) different
return values, being EVAL_BODY_INCLUDE, EVAL_BODY_BUFFERED, or
SKIP_BODY.
I don't see how the difference is "silly". It was a good idea to
separate them, so tags which don't need to manipulate their body can be
more efficient.
-----Original Message-------
From: Mark R. Diggory [mailto:[EMAIL PROTECTED]]
Thanks, yes that appeared to be it. I'm always running into this "silly" issue of TagSupport vs. BodyTagSupport and the difference in the constants.
TagSupport --> EVAL_BODY_INCLUDE or SKIP_BODY
BodyTagSupport --> EVAL_BODY_BUFFERED or SKIP_BODY
Seems that the JSP Taglib spec has alot of this use of constant ints in situations where boolean return values would do just fine and save on the confusion. But thats a different issue for a different list... ;-)
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>