struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject RE: Formatting dates in <html:text>
Date Wed, 26 Mar 2003 19:16:26 GMT


On Wed, 26 Mar 2003, Greg Dunn wrote:

> Date: Wed, 26 Mar 2003 12:37:14 -0600
> From: Greg Dunn <greg.dunn@mo.nisc.cc>
> Reply-To: Struts Users Mailing List <struts-user@jakarta.apache.org>,
>      greg.dunn@mo.nisc.cc
> To: Struts Users Mailing List <struts-user@jakarta.apache.org>
> Subject: RE: Formatting dates in <html:text>
>
> The JSTL <fmt:formatDate> is great for display only.
>
> IMHO there should be a way to format a date, or round a float to 2 decimal
> places etc. built into the html:form tags to work with the property you've
> got.  It would defeat i18n but if you need a certain format, you aren't
> using it anyhow.  It seems there are many people using all sorts of
> different workarounds.
>

What you probably want is a nice GUI component model (which is somewhat
more than the Struts HTML tags aspire to be).  One avenue to explore would
be using JavaServer Faces -- you can get an EA3 release from:

  http://java.sun.com/j2ee/javaserverfaces/

and there's a Struts-Faces integration library that makes it very easy to
use the two technologies together:

  http://jakarta.apache.org/builds/jakarta-struts/nightly/struts-faces/

For your particular scenario, you'll want to look at things like the
<h:input_date> and <h:input_number> tags.  Among other things, there are
variants that let you specify date and number formats.

None of this code is "ready for prime time" yet, but it's definitely the
direction I would recommend for the future.

> I'm relatively new at this, so I could be way off base.  I'd like to know if
> I am but try to be kind if I'm being a moron. ;-)
>

No, it sounds like you've identified a very real issue :-).

>
> Greg

Craig

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message