struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Edgar Dollin <Ed...@BLUE-MOOSE.NET>
Subject RE: Formatting dates in <html:text>
Date Wed, 26 Mar 2003 18:10:20 GMT
If you just want to display, the <bean:write> tag has some date formatting

For entry the 'best' current solution is to subclass the TextTag class and
do your processing there.  The strategy I have been using in such a tag is
to use a 'hidden' field with your actual form data and javascript to do the
translations to another field the user actually edits, of course returning
the altered text to your hidden field.

One of the javascript guys was asking about a hypothetical date tag, but I
don't remember the details or the status.


> -----Original Message-----
> From: Greg Dunn [] 
> Sent: Wednesday, March 26, 2003 11:52 AM
> To: 'Struts Users Mailing List'
> Subject: Formatting dates in <html:text>
> I'm trying to display a date in a particular format in an 
> <html-el:text> box.  I'm filling my form bean from my DAO 
> which returns a timestamp, and
> <html-el:text size="10" property="presReadingDate" 
> value="${meterReading.dtPresReadDt}"/>
> displays the long date/time format 'Tue Mar 26 10:45:59 CST 
> 2003' which is no good.
> I was looking at a discussion on this topic in the archives, 
> but it appears that it was left as "food for thought"

I use the JSTL <fmt:formatDate> tag to display a date outside a form, but it
can't be nested so it's no good here.

This scenario seems like it would be fairly common.  What does one do here?
Format the date in a get/set pair in their bean and display that?  Use basic
HTML <input type="text"> tags?  What's best practice?



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message