> >>>Hi,
> >>>
> >>>I defined 2 actions in session scope referring the same 
> >>>
> >>form. The first
> >>
> >>>action sets some properties in the form and then forwards 
> >>>
> >>the request to the
> >>
> >>>second action. The second action sets some more properties 
> >>>
> >>and then forwards
> >>
> >>>to a JSP page which contains the html form. The problem is 
> >>>
> >>only the data set
> >>
> >>>by the last action remains... This makes me think the 
> >>>
> >>form-bean is not
> >>
> >>>shared between actions. I understand this can be desired 
> >>>
> >>behaviour. Any
> >>
> >>>insight would be appreciated. thanks!
> >>>
> >>This is exactly why action chaining is not recommended. When 
> >>you forward
> >>from one action to another, the effect is as if a new 
> request has been
> >>made. As a result, Struts will call the form bean's reset() 
> >>method, and
> >>then the form bean will be repopulated from the request 
> >>parameters. Any
> >>changes made to the form bean will be lost.
> >>
> >>Please note that this is not a Struts-related issue. This 
> behaviour is
> >>well defined by the Java Servlets spec.
> >>
> >
> >This is still a trouble to me to read that, and then try to 
> understand how 
> >forms-on-multiple-pages are handled.
> >
> >Anyway, what's the work to add a "reset=on/off" attribute to the
> >action-mapping
> >to control the reset call ? Would it be a major change?
> >
> >This e-mail is intended only for the above addressee. It may contain
> >privileged information. If you are not the addressee you 
> must not copy,
> >distribute, disclose or use any of the information in it. If you have
> >received it in error please delete it and immediately notify 
> the sender.
> >Security Notice: all e-mail, sent to or from this address, may be
> >accessed by someone other than the recipient, for system 
> management and
> >security reasons. This access is controlled under Regulation of
> >Investigatory Powers Act 2000, Lawful Business Practises.
> >
> >--
> >To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> >For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> >
> >
> >
> I think you might be confused as to how a forward is handled 
> within the 
> framework.
> 
> If you look at it from a high level:
> 
> 
> using your own configuration (whatever it is):
> 
>  http-request  ->  Container  -> Struts  -> [your action class]
>                                             (returns success)
>                                            /
>                                 Struts  <-'
>                                   (calls forward /whatever.do)
>                                  /
>                   Container   <-'
>                       |
>                        `->      Struts   -> [your action class]
> 
> You can see how Struts doesn't know that the forward was not 
> a new request.

It does not know so it ALWAYS reset().
Well, how do you handle a 2-pages form ?

<action path="/One" form="foobar" validate="true" input="One.jsp">
 <forward path="/Two.do"/>
</action>
<action path="/Two" form="foobar" validate="true" input="Two.jsp">
 <forward path="/Success.do"/>
</action>

<action path="/Populate">
 <forward path="/One"/>
</action>

One.jsp
...
<html:form action="/Populate">
...

Two.jsp
...
<html:form action="/Populate">
...

? If it reset() all the time, you will always stop at One.do ...

I would have prefered to disable reset() for those actions.

This e-mail is intended only for the above addressee. It may contain
privileged information. If you are not the addressee you must not copy,
distribute, disclose or use any of the information in it. If you have
received it in error please delete it and immediately notify the sender.
Security Notice: all e-mail, sent to or from this address, may be
accessed by someone other than the recipient, for system management and
security reasons. This access is controlled under Regulation of
Investigatory Powers Act 2000, Lawful Business Practises.

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to