struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kamholz, Keith (corp-staff) USX" <>
Subject RE: question on ActionForm properties.
Date Mon, 24 Jun 2002 13:07:33 GMT
I'm not sure what the disadvantages would be, but if you need to make many
conversions, you could make a general conversion class that has a bunch of
static methods for the conversions that you could just call from your
getters/setters.  I love static methods, the code is very reusable and cuts
down on headaches.  However, I am a newbie, so there could be disadvantages
or problems that I don't know about.

Keith Kamholz
East Aurora, NY
(716) 687-7282

-----Original Message-----
From: Anand Raman []
Sent: Monday, June 24, 2002 9:02 AM
To: Struts Users Mailing List (E-mail)
Subject: question on ActionForm properties.

hi guys

In one of mail sent to this mailing list I read  

"form bean properties should generally be strings, and you should do the
conversion to int (or any other datatype) later".

My questions is there any specific reason why it should be done this way. I
understand that it is necessitated by the HttServletRequest object but has
there been any discussions of having properties with different/custom data
types in a ActionForm apart from just Strings. 

Having properties with different data types (e.g Date, BigDecimal) would
help in faster development of code in the model as the data type conversions
wouldnt need to be repeated multiple times (assuming my action class
delegates the actual business functionality to a series of modelers), plus
it would also help in doing business rule validations (e.g start_date <
end_date etc)

I understand nothing prevents me from having any other data types in a
ActionForm. If people have been doing such things what has been the strategy

If this has been already discussed can you please point on the threads in
the mailing list archives.

Thanks for your time.

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

View raw message