From: <[EMAIL PROTECTED]>
> Is there some way for a defined tag to check/get the content of it's body?
>
> let's say I have a tag defined:
>
> <define:tag name="exec">
> <exec dir="." executable="${maven.ssh.executable}">
> <arg line="${maven.repo.central} -l ${maven.username}
> '${command}'"/>
> </exec>
> </define:tag>
>
> Which I'd like to get ${command} from the tag body the user provides, or
> the attribute, in that order, e.g. support:
>
> <tag:exec>
> text/other jelly stuff here
> </tag:exec>
>
> or
>
> <tag:exec command="asdasd" />
To invoke the tags body from inside a dynamic tag use <define:invokeBody/>
If you wish to capture the output of the body as a variable and then pass it
into some other tag/bean/method then try something like this (warning - this
is untested, am just typing it straight into an email client which doesn't
yet have Jelly support :)
<define:tag name="exec">
<!-- allow either command attribute or use body of exec tag -->
<j:if test="${empty(command)}">
<j:set var="command"><define:invokeBody/></j:set>
</j:if>
<exec dir="." executable="${maven.ssh.executable}">
<arg line="${maven.repo.central} -l ${maven.username}
'${command}'"/>
</exec>
</define:tag>
James
-------
http://radio.weblogs.com/0112098/
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]