Thanks for the pointer.  I don't quite follow why useBean is necessary in
your example.

I wrote my own tag for this.  It's very simple - it's just a body tag that
does: pageContext.setAttribute(id, getBodyContent().getString()).  It's
useful in those cases where you want to nest tags but can't.  Instead of:

<x:tag1 attr1='<x:tag2/>'/>

you do:
<y:eval id='anId'><x:tag2/></y:eval>
<x:tag1 attr1='<%= (String) pageContext.findAttribute("anId") %>'/>

Providing a TEI class would shorten this a lot, but I haven't gotten around
to it yet...

Pierre Delisle wrote:

> John Raley wrote:
>
> > Is there a tag (in struts or elsewhere) that will evaluate its body into
> > a String that can be squirreled away for later use?
>
> John,
>
> I'm just finishing implementing a tag library that may help you out.
> I shall submit it to jakarta-taglibs by the beginning of next week.
>
> My tentative name for the tag library is "IOAdapter".
> Its goal is to provide a generic mechanism by which a variety of
> input sources can be copied to a variety of output sinks, with
> an optional transformation applied on the input source before
> it is copied over.
>
> In your case, it would look something like the following:
>
>   <jsp:useBean id="tmp" class="java.lang.String"/>
>   <x:ioa outBean="tmp">
>     ... content ...
>   </x:ioa>
>
> If an "in" argument is not specified in the 'ioa' tag, input
> comes by default from the tag's body content.
>
> Would that fit your requirements?
>
>     -- Pierre

Reply via email to