struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andy Kriger" <>
Subject RE: Best way to handle this in Struts/MVC ?
Date Thu, 12 Dec 2002 18:43:49 GMT
I put data storage beans that need to be displayed into the request or
session and use bean:write and logic:iterate on the JSP. I don't see the
sense in creating extra objects targeted to display; just keeping the
get/set methods generic (return a Date, not a formatted Date String) should
be enough.

For date formatting, I use the datetime custom tags for dates
( - a caveat
the format tag uses long values so if your obj has a method Date getDate()
the property in the tag should be "date.time" (which will call the Date
obj's getTime() method that returns a long).

For number formatting, I use my own custom tag (that wraps

-----Original Message-----
From: Rick Reumann []
Sent: Thursday, December 12, 2002 13:17
To: Struts List
Cc: model struts
Subject: Best way to handle this in Struts/MVC ?

For all of my forms I have an appropriate DynaValidatorForm bean
defined in my struts-config file. This form eventually populates a
bean (Data Transfer Object) that corresponds to the form bean but with
the correct data types (ie java.util.Date birthDate vs String
birthDate ).

The question I have is when generating a List to display the beans is
it really that bad to use the actual Data Transfer objects beans in
the display (vs a List of the DynaFormBeans)? The reason I ask is it
seems like a lot of overhead to convert a Collection of data transfer
objects into a whole new collection of DynaFormBeans, especially if
the List is quite large. The problem though is if you use the DTOs you
have to code in those beans proper formats for displaying such things
as Dates.

How do others handle this situation?




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

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

View raw message