Struts 2 CRUD Question

2008-09-29 Thread Bobby Politte
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

Re: Struts 2 CRUD Question

2008-09-29 Thread Dave Newton
--- On Mon, 9/29/08, Bobby Politte wrote: > 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),

Re: Struts 2 CRUD Question

2008-09-29 Thread Giovanni Azua
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

Re: Struts 2 CRUD Question

2008-09-29 Thread Giovanni Azua
hi again, According to what Dave explains then my recommendation does not apply. Maybe you should check what values you are initializing the User DTO model to, maybe some of the fields are initialized as null or maybe you think you are updating but Struts is actually creating a new DTO object.

RE: Struts 2 CRUD Question

2008-10-09 Thread Gawain Hammond
ember 2008 16:44 To: user@struts.apache.org Subject: Struts 2 CRUD Question 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, u

RE: Struts 2 CRUD Question

2008-10-09 Thread Dave Newton
--- On Thu, 10/9/08, Gawain Hammond wrote: > Does struts create a new object for every submit? And under > what circumstance would it not? Actions are created per-request, thus action variables are as well. Options include retrieving a session object manually, using ScopedModelDriven, a conversa

Re: Struts 2 CRUD Question

2008-10-10 Thread stanlick
; From: Dave Newton [mailto:[EMAIL PROTECTED] > Sent: 09 October 2008 17:20 > To: Struts Users Mailing List > Subject: RE: Struts 2 CRUD Question > > --- On Thu, 10/9/08, Gawain Hammond wrote: > > Does struts create a new object for every submit? And under > > what circumstan

Re: Struts 2 CRUD Question

2008-10-10 Thread Alberto Flores
om: Dave Newton [mailto:[EMAIL PROTECTED] Sent: 09 October 2008 17:20 To: Struts Users Mailing List Subject: RE: Struts 2 CRUD Question --- On Thu, 10/9/08, Gawain Hammond wrote: Does struts create a new object for every submit? And under what circumstance would it not? Actions are created per-requ

Re: Struts 2 CRUD Question

2008-10-10 Thread Dave Newton
--- On Fri, 10/10/08, Alberto Flores <[EMAIL PROTECTED]> wrote: > Don't you mean scope="request" and not "prototype"? No, "prototype" is the correct scope for action beans. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For a

Re: Struts 2 CRUD Question

2008-10-10 Thread Alberto Flores
So, from the Spring documentation: prototype: Scopes a single bean definition to any number of object instances. request: Scopes a single bean definition to the lifecycle of a single HTTP request; that is each and every HTTP request will have its own instance of a bean created off the back o

RE: Struts 2 CRUD Question

2008-10-10 Thread Gawain Hammond
long shot, but I'm stumped. I've not written any custom interceptors or anything, it's all pretty bog standard actions and struts forms. -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: 09 October 2008 17:20 To: Struts Users Mailing List Subject: R

Re: Struts 2 CRUD Question

2008-10-10 Thread Dave Newton
--- On Fri, 10/10/08, Alberto Flores wrote: > prototype: Scopes a single bean definition to any number of > object instances. > > request: Scopes a single bean definition to the lifecycle > of a single HTTP request; that is each and every HTTP request > will have its own instance of a bean create