How about the JSLT formatting tags? They can do the type of conversion you
describe, in the JSP. Which I think is more desireable than having your
actionform or action know about the formatting (which in this case is more
presentation)

-----Original Message-----
From: Aaron Longwell [mailto:[EMAIL PROTECTED]
Sent: Monday, June 23, 2003 12:00 PM
To: Struts-User
Subject: Where to do TextConversion?


Struts Users,

I'm adding some currency fields to an ActionForm in struts. The data is
stored as float in the database. I'm wondering where to do conversion
between a "$6.70" that's displayed to the user on the form, and the 6.7
that's stored in the database. Should I use the java.util classes in the
Action? Or should I add a:

setPrice(java.lang.Float)
getPrice java.lang.Float()

to the ActionForm... and handle conversion within the ActionForm methods?

I may be suffering from a case of the Mondays... but I can't seem to
think which would be better or more appropriate. I am nearly finished
with this, my first Struts project.

Thanks,
Aaron


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to