Hi,

I have had same problems when displaying dates.
The only solution I found was quite similar but maybe a little more flexible
since you can choose to display nothing:
<s:property value="#item.referenceDate != null ?
getText('format.date',{#item.referenceDate}) : '&nbsp;'" escape="false"/>

Samuel

2009/11/7 Burton Rhodes <burtonrho...@gmail.com>

> The following entry works fine, but when "xaction.contractPrice" is
> NULL it prints out "null" on my web page.
> <s:text name="format.money"><s:param
> value="#xaction.contractPrice"/></s:text>
>
> This sort of fixes the issue, but I would prefer to not display a "$0".
> <s:text name="format.money"><s:param
> value="%{#xaction.contractPrice==null ? 0 :
> #xaction.contractPrice}"/></s:text>
> This does not work as I get an error: "cannot forward object as a number"
> <s:text name="format.money"><s:param
> value="%{#xaction.contractPrice==null ? ' ' :
> #xaction.contractPrice}"/></s:text>
>
> Properties file entry:
> format.money = {0,number,\u00A4###,##0}
>
> Is there something simple I am missing or a better way to do this? Is
> there a "$!" like freemarker or a "default value" parameter?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

Reply via email to