struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Reumann <maill...@reumann.net>
Subject Re: java.util.Dates and Struts
Date Mon, 23 Dec 2002 20:51:10 GMT
On Mon, 23 Dec 2002 12:32:13 -0500
Jim Krygowski <james.krygowski@shaws.com> wrote:

> It seems like the only way things work out properly in the rendering
> phase is to have a ValueObject that contains the Date properties and
> an ActionForm that has a String for each Date on the ValueObject. 
> This is what I was originally hoping to avoid.  My ActionForm contains
> graphs of ValueObjects that I render using the nested tags.  It'd be
> really painful to come up with a parallel set of ValueObjects that
> have Strings instead of Dates.
> 
> Is there any way to get formatted Dates from the <html:text> and like
> tags or am I stuck?

I must be missing something here:) I think I see what you are doing
now... you are wanting to use the ValueObject in the jsp display. In
that case why not just use of the tag libraries that display dates in
whatever format you like. Then you won't even need to bother with the
converters or BeanUtils. To format Dates in jsp pages I now use the JSTL
format tags. It's then simply a matter of doing
<fmt:formatDate pattern="MM/dd/yy" value="${element.yourDate}"/> 
I'm sure you could define the pattern globally for the whole page, I
just was lazy and didn't look into it.

I think that will solve your problem?

-- 
Rick

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


Mime
View raw message