You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by James Strachan <ja...@yahoo.co.uk> on 2003/03/07 13:20:23 UTC

[jelly] now supports a defaultValue attribute if value="" is null or blank

When writing Jelly scripts (especially Maven plugins) it seems common to do
things like this

    <j:set var="foo" value="${maven.foo}"/>
    <j:if test="${empty(foo)}">
        <!-- default to some other value-->
        <j:set var="foo" value="some default"/>
    </j:if>

I've just added an extra attribute to the <set> tag to make this kind of
thing easier that if the value is null (or an empty String) then the
defaultValue is used instead.

    <j:set var="foo" value="${maven.foo}" defaultValue="${some default}"/>

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