tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark R. Diggory" <>
Subject [OT reply to] Re: Stuck in Mud... Need your help...
Date Mon, 16 Dec 2002 18:59:27 GMT
IMHO, its actually quite simple (I know this is the wrong list for this 
discussion so, I'll mark it "OT")..

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

	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 

	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),

Karr, David wrote:

>The return value from "doStartTag()" can have three (more?) different
>return values, being EVAL_BODY_INCLUDE, EVAL_BODY_BUFFERED, or
>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 []
>>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.
>>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:   <>
>For additional commands, e-mail: <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message