> 
> I am using struts 1.1. What I would like to know is whether a 
> new form 
> bean is created in the following situation:
> 
> An action sets a form bean as an attribute and passes it for 
> display to 
> the appropriate jsp page and its contents displayed. This form is 
> updated and submitted to a different action. Now, is the form 
> bean that 
> submitted the second time the same as the first form or has a 
> new form 
> bean been created and its fields re-populated.
> 

Firstly, the page that displays the form uses the version that was saved by the first 
action only if its under the same key.  For example, if the first action saved the 
form-bean to the session under the key "foobean", then this instance will be used only 
if 

* you refer to it by the key "foobean" on the page
* it is the form-bean associated with (the) <html:form> on this
  page and respective action mapping's name attribute is "foobean"

Otherwise, a new instance of this bean will be created (in the second case).  Another 
issue to be careful with is forwarding versus redirecting.  If the first action above 
persists the bean to the *request* and you redirect to the JSP, the bean is lost 
(since redirect results in a new request object).

Hope this helps

Sri

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

Reply via email to