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/>
<i18n:formatDate pattern="yyyy MMMMM ddd hh:mm:ss"/>
<i18n:formatDate style="short"/>
<i18n:formatTime/>
<i18n:formatTime style="medium"/>
<i18n:formatTime value="<%= date %>"/>
<i18n:formatDateTime/>
<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
JSP.
<i18n:formatNumber value="<%= n %>" defaultText="not applicable"/>
Any comments?
James
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com