John Yu wrote:
> 
> It would be useful to have an 'alt' attribute on <bean:message> tag. eg.
> 
>   <bean:message key="blah" alt="DefaultLabel"/>
> 
> There are two uses:
> 
>    * In case Struts fails to find the message/resource, it can display the default 
>label (and display a warning on the console).
>    * For design-time tools (eg. Dreamweaver), it will be easier for the tools to 
>display some meaningful mock-up labels at design-time.
> 
> Similarly, for <bean:write>, we can have
> 
>   <bean:write name="blah" property="blah" mock="MockLabel"/>
> 
> What do you think?

This is the approach taken in the <expr> tag of JSPTL.
(http://jakarta.apache.org/taglibs/doc/jsptl-doc/jsptl-ea1/ExpressionTags_FunctionalDescription_1_EA1.html)

The default value can be specified either via attribute default: 

    <jx:expr value="$customer.address.city" default="unknown address"/> 

or within the body of the tag: 

    <jx:expr value="$customer.address.city"> 
       <acme:defaultCity/> 
    </jx:expr> 


      -- Pierre

Reply via email to