You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by bs...@uark.edu on 2004/07/11 10:39:06 UTC

ECS and tags with bodies

I'm confused about whether I can use ECS for tags that have bodies. I'd like to create an XHTML document using ECS in my doStartTag, but if I print the document and then return EVAL_BODY_INCLUDE, obviously I'll get an XHTML document with an empty body followed by the stuff that should have been in the body.

Somehow I need to be able to (within doStartTag) create an XHTML document and set the body of my document to the result of the evaluation of the body of the tag. But I don't know how to do that, or if it's possible.

Please help. Thanks.


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org


RE: ECS and tags with bodies

Posted by Martin Cooper <ma...@apache.org>.

> -----Original Message-----
> From: bsl04@uark.edu [mailto:bsl04@uark.edu]
> Sent: Sunday, July 11, 2004 1:39 AM
> To: taglibs-dev@jakarta.apache.org
> Subject: ECS and tags with bodies
>
>
> I'm confused about whether I can use ECS for tags that have
> bodies. I'd like to create an XHTML document using ECS in my
> doStartTag, but if I print the document and then return
> EVAL_BODY_INCLUDE, obviously I'll get an XHTML document with an
> empty body followed by the stuff that should have been in the body.
>
> Somehow I need to be able to (within doStartTag) create an XHTML
> document and set the body of my document to the result of the
> evaluation of the body of the tag. But I don't know how to do
> that, or if it's possible.

ECS isn't really a good fit for JSP tags, because it's based around the
notion of building up a complete document and then rendering it, whereas JSP
tags are more likely to output document fragments along the way.

That said, you *might* be able to do what you want from doEndTag instead of
doStartTag. The idea would be to have your doStartTag create the ECS
document, but not render it, and then have your doEndTag retrieve the body
content, add it to the ECS document somehow (sorry, I don't know ECS enough
to know if, or how, this can be done), and then render it.

If there's no way to add the body content into your ECS document, though, I
believe you're out of luck.

--
Martin Cooper


>
> Please help. Thanks.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org