jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james_strac...@yahoo.co.uk>
Subject new <i18n:formatXXX> tags available (was Re: datetime TAGlib -> FormatTag.java)
Date Sat, 28 Apr 2001 15:09:45 GMT
I've just checked into CVS implementations of the following tags into the
i18n tag library. There is an example format.jsp in the examples web app
that demonstrate their use. I'll improve the examples and documentation
later next week.

I haven't done <i18n:formatString> yet nor do I cache the DecimalFormat /
SimpleDateFormat instances yet.
As discussed for date/datetime/time tags, the value defaults to 'now' if its
not specified.

    <i18n:formatDate pattern="yyyy MMMMM ddd hh:mm:ss"/>
    <i18n:formatDate style="short"/>

    <i18n:formatTime style="medium"/>
    <i18n:formatTime value="<%= date %>"/>
    <i18n:formatDateTime dateStyle="short" timeStyle="short"/>

    <i18n:formatNumber value="<%= n %>"/>
    <i18n:formatNumber value="<%= n %>" pattern="##,###,###.##"/>
    <i18n:formatCurrency value="<%= n %>"/>
    <i18n:formatPercent value="<%= n %>"/>

The tags also support the "defaultText" attribute which is used if a value
passed in is null. This value defaults to "" to avoid "null" appearing in

    <i18n:formatNumber value="<%= n %>" defaultText="not applicable"/>

Any comments?


Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

View raw message