> -----Original Message-----
> From: David Winterfeldt [mailto:[EMAIL PROTECTED]] 
> Sent: maandag 22 oktober 2001 19:51
> To: [EMAIL PROTECTED]
> Subject: Re: Form properties reset ?
> 
> 
> --- Ted Husted <[EMAIL PROTECTED]> wrote:
> > You can also be more careful about which properties
> > are reset when. Both
> > the mapping and the request are passed to reset,
> > giving you the
> > opportunity to look ahead.
> > 
> > The default reset does nothing. The properties are
> > only affected if
> > you've overridden this class and specified what
> > happens to the
> > properties before the form is populated from the
> > request.
> > 
> > If you forward to another Action, any properties you
> > changed in a
> > previous Action will revert to the original, since
> > these are populated
> > from the request again. But if you are only setting
> > additional
> > properties, then this won't be a problem.
> 
> Unless you have a checkbox on your form and you have
> validation.  Then in the case that a checkbox that was
> checked and the page fails validation. The user is
> then returned to the form to fix their input and
> unchecks the checkbox.  Nothing will be submitted for
> the checkbox (this is an html form issue) so the
> property with your checkbox will still be checked.  So
> any checkbox fields need to be in the reset method
> (other fields don't have to be). 
> 
> David

So the reset() method is only used for redisplaying a form, not for e.g.
pooling of the form objects?

This clarifies a whole lot, thanks a lot! (and of course thanks to the
other answerers also, everything I can learn about struts is welcome)

tomK

> 
> > 
> > -- Ted Husted, Husted dot Com, Fairport NY USA.
> > -- Custom Software ~ Technical Services.
> > -- Tel +1 716 737-3463
> > -- http://www.husted.com/struts/
> > 
> > [EMAIL PROTECTED] wrote:
> > > 
> > > Yes, I would expect this. Any properties you set
> > in the form bean from the
> > > first action will be cleared when the form bean is
> > reset prior to
> > > populating it for the second action.
> > > 
> > > If you need to add additional parameters to the
> > request, you'll need to do
> > > it by adding them to the URL used to invoke the
> > second action.
> > > Alternatively, you could avoid the use of
> > parameters, and pass them as
> > > request attributes instead.
> > > 
> > > --
> > > Martin Cooper
> > > 
> > > At 08:56 AM 10/19/01, Tom Klaasen (TeleRelay)
> > wrote:
> > > >Hi all,
> > > >
> > > >I noticed the following:
> > > >
> > > >I have a jsp with a corresponding form. When I
> > press "submit", it gets
> > > >forwarded to an Action which sets some additional
> > properties on the
> > > >form. Then I forward to another Action. When I
> > read the additional
> > > >properties of the form, they have disappeared. Is
> > this normal behaviour?
> > > >And if so, why?
> > > >
> > > >thanks,
> > > >tomK
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Make a great connection at Yahoo! Personals.
> http://personals.yahoo.com
> 

Reply via email to