The life cycle is that when a form is submitted, Struts looks up the
ActionMapping for the URI. If it uses a form, Struts checks the request
for an existing object. If one is there, Struts clears it with the
reset() method, or creates a new object if needed. The request
properties are scanned, and Struts tries to find a setZZZ method for
each request property. If it finds a match, the accessor is called to
populate the form property from the request. The form properties are
only changed by reset() or when a request property has a matching setZZZ
method in the form.

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 737-3463.
-- http://www.husted.com/about/struts/


Matt Raible wrote:
> 
> My form has 2 get/set methods - one for action and another for a bean which I
> pass to an EJB.  The problem I am having is that certain elements of the bean
> are getting set to their default values on save, rather than using the values
> set in the EditAction.
> 
> Is is true that the bean must have set methods for everything in order for the
> save to work correctly?  I'm suspecting that I need set methods for everything,
> and then the elements I'm having problems with will get set correctly, rather
> than back to their default values.
> 
> Is this true?

Reply via email to