jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: datetime TAGlib -> FormatTag.java
Date Fri, 27 Apr 2001 16:02:22 GMT


On Fri, 27 Apr 2001, James Strachan wrote:

> Hi Tim
> 
> Thanks for your reply Tim - I've actually checked with the JavaDoc so have a
> clearer idea of what I was talking about :-)
> 
> 
> > > <i18n:formatDate value="<%= new Date() %>" style="short"/>
> > >
> > > <i18n:formatDate value="<%= new Date() %>" pattern="yyyy.MMMMM.dd
GGG
> > > hh:mm"/>
> >
> > style and pattern are both used identically in MessageFormat
> 
> I wasn't really thinking of using MessageFormat in the implementation of
> these tags - I was thinking of using the DateFormat / SimpleDateFormat or
> NumberFormat / DecimalFormat classes directly.
> 

These classes are really cool, but can be problematic for performance if
not used carefully.  For example, we'll probably want to pool format
instances (keyed by pattern string and locale) instead of creating them on
the fly every time.  This might be an opportunity to look at the object
pooling package in jakarta-commons.

On that note, I haven't looked at the code yet, but would it be possible
to abstract out the actual format processing from the tags it's used
in?  What is motivating this is that I'd like to be able to support
formatting as an optional service in things like the <html:text> tag in
Struts, and reusing your code would make me have to do less work :-).


Craig


Mime
View raw message