hi,

One way I can think of is to use hidden fields in your forms, to pass long the values you do not want changed. This way you keep your Model-driven action consistent and you pass along the parameters that you do not want the user to change in each use-case.

A not so clean way would be to break the model-driven action standard and have couple of custom actions that provide only the diff of the data you want to have edited butt this is pretty ugly I think.

I would also be interested to know other alternatives but if I were in your situation, I would definitely go for #1

HTH,
Regards,
Giovanni

Bobby Politte wrote:
Hi,

I'm just getting back into Struts after a few years away from web
programming.  I've got a question about methods for updating only
certain members of an object.

I've got a struts action that creates, updates and deletes a User
object. When updating though, I have two different jsp pages that
update only part of the object (user information on one, and password
on the other).  Unexpectedly (at least to me), Struts sets the members
of the User object not on the form to null.  I'd expected it to only
update the members specifically tied to controls on the form and
assume no change for any members of User *not* in the form.

Is there a way to only update those members of the object represented
on the form?  Do I *need* to use some DTO to do this?  Or split my
User object up into User and Password objects?

thanks,

Bobby

---------------------------------------------------------------------
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