Isn't an Action part of the presentation?
It has a handle to HttpServletRequest and HttpServletResponse.

If I had EJB Session (or session like bean) I would call that
from an Action and I could call that from a Swing program as well.

I wouldn't call the Action class from a Swing program (because,
obviously the Action class is for Http protocol only and therefore
a specific presentation and therefore part of the presentation.

So putting that stuff in the Action seems fine to me.

This is just opinion, of course.




-----Original Message-----
From: Mike Jasnowski [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 23, 2003 12:02 PM
To: Struts Users Mailing List
Subject: RE: Where to do TextConversion?

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]

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

Reply via email to