Thanks to the newbie Struts 1.2 FAQ, I realized what I was doing wrong. Now I'd understood how to prepopulate the ActionForm in the Action, and use Reset method only for View independent initialisation.

   http://struts.apache.org/struts-doc-1.2.x/faqs/newbie.html#prepopulate

   Cool


       <action path="/FirstAction" type="action.First">
           <forward name="success" path="/form.jsp" />
           name="Form"
           scope="request"
       </action>

       <action path="/FirstActionSubmit" type="action.FirstSubmit"
           name="Form"
           scope="request"
           input="/form.jsp"
           validate="true"
       >


----- Original Message ----- From: "Marcio Ghiraldelli" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Thursday, March 23, 2006 11:05 AM
Subject: Re: Strange Form Reset Behavior



In the example below, the "FirstAction" action is responsable for getting a list from the db and pass it to the form "Form".

During the execution of the "action.First" class, doesn't exists yet any instance of the form. When the "action.First" class redirects to the "form.jsp", after loading the refered list, there exists an <htm:form action="/FirstActionSubmit"> and here the Struts creates a new instance of the form.

So, how can I pass the list loaded in the "FirstAction" to the "Form", without using request?
   The form instance is only created in the view!

   - puzzled! -

       <form-bean name="Form" type="forms.Form" />

       <action path="/FirstAction" type="action.First">
           <forward name="success" path="/form.jsp" />
       </action>

       <action path="/FirstActionSubmit" type="action.FirstSubmit"
           name="Form"
           scope="request"
           input="/form.jsp"
           validate="true"
>


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

Reply via email to