I've been using Stripes for over a year now, but I've never been able  
to get DateFormatter working as I understand it should work.

As an example, I have a date input field in a form:

<s:text name="startShipDate" formatType="date" formatPattern="short"/>

startShipDate is a java.util.Date field, which I am initializing to  
six months prior to today (e.g., January 2, 2008).  When this form  
initially renders, my form input field is initialized with "Wed Jan 02  
00:00:00 CST 2008", which is not what I would expect.

While debugging, I see that  
net.sourceforge.stripes.format.DateFormatter.init() is getting  
invoked, and the "format" variable is correctly set to "M/d/yy" (short  
in my locale).  However, the format() method is never invoked, so  
nothing ever really happens.  Instead, the long "Wed Jan 02 00:00:00  
CST 2008" value is set simply as a result of startShipDate.toString().

I thought DateFormatter was intended to format a Date object to a  
String (according to the formatPattern specified), and then to attempt  
to convert the form value back to a Date object upon submit.

I'm using stripes-1.5RC1, but this is not new behavior.  I would  
really appreciate any help, because my work-around has been to do all  
of the formatting brute-force in each of my pages (using String rather  
than Date objects).

Thanks,
Shawn


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to