> -----Original Message-----
> From: Sebastian Ho [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, August 24, 2004 11:22 PM
> To: Struts Users Mailing List
> Subject: ActionForm and Transfer Object
> 
> 
> Hi
> 
> People have been telling me that ActionForm should not be dependent on
> your TO. Simple because actionForm is for presentation and TO for your
> business requirement. Sounds logical and right way to go.
> 
> Now that I started developing using struts, it is actually not that
> simple. 
> 
> Say I retrieve a TO from database and convert it into a actionForm for
> display. In this case I have 4 fields for my actionForm but 
> 10 in my TO.
> (6 are not needed for display). A user updates the 4 fields and the
> action convert those into TO. In this case, the other 6 fields will be
> reset to null(or empty) in my database!
> 
> To prevent this, I actually need to use hidden fields in my 
> JSP or some
> other ugly solutions in my Action class. They are still dependent on
> each others afterall.
> 
> Is there a solution to this or I am missing something here?

Not really.  The problem isn't struts.  It's the way the web works as opposed to a 
gui.  
If you want to keep from having to make the second DB call, and avoid hidden fields, 
put the original TO in session, and use that instead of the DB call.  Course, when 
you're done with it, null it out.


> 
> Thanks
> 
> Sebastian Ho
> 
> 
> ---------------------------------------------------------------------
> 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