I do have the dynamic="true" set too.

<form-bean name="Form1" type=".... DynaValidatorForm" dynamic="true">
    <form-property name="typeName" type="java.lang.String"/>
......
</form-bean>


From: "fea jabi" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <user@struts.apache.org>
To: user@struts.apache.org
Subject: form-property value set in dispatch action is lost
Date: Tue, 19 Sep 2006 15:43:37 -0400

In struts config have a Dynavalidator form-bean

<form-bean name="Form1" type=".... DynaValidatorForm">
    <form-property name="typeName" type="java.lang.String"/>
......
</form-bean>

have prepare(Action) and dispath(LookupDispatchAction) actions for the jsp in the config which are session scoped.

<action
           path="/PrepareAction"
           type="com.PrepareAction"
           name="Form1"
           scope="session">
<forward name="success" path="/pages/Accounts.jsp" redirect="false"/>
       </action>

<action
           path="/DispatchAction"
           type="com.DispatchAction"
           name="Form1"
           scope="session"
           parameter="method">
<forward name="successCalc" path="/PrepareAction.do" redirect="false"/>
     </action>


In the jsp have a submit button which dispatches to the dispatch action to one of the methods in it.
I am setting one of the form property value in that method.


public class DispatchAction extends LookupDispatchAction {

        protected Map getKeyMethodMap() {
                    Map map = new HashMap();
                    map.put("btn.calc", "calc");
               }

               public ActionForward calculate(ActionMapping mapping,
                        ActionForm form,
                        HttpServletRequest request,
                        HttpServletResponse response)
                        throws IOException, ServletException {
                DynaValidatorForm frm = (DynaValidatorForm)form;

                               frm.set("typeName", "xxxxx");

                           return mapping.findForward("successCalc");
              }

    }


setting the form-property value in the dispatch action i.e the "typeName" to "xxxxx"

When it is sucess it is going back to the prepare action and the form property value is "" instead of "xxxxx". checked at the first statement in the execute method in prepare action the form-property value is different.

not sure why the form-property value is different in prepare action as before. When in dispatch action the form-bean had the right value i.e the form-property in form-bean to "xxxxx". but when came to prepare it's value is lost.

why is this happenning? how can this be fixed?

Thanks.

_________________________________________________________________
Express yourself - download free Windows Live Messenger themes! http://clk.atdmt.com/MSN/go/msnnkwme0020000001msn/direct/01/?href=http://imagine-msn.com/themes/vibe/default.aspx?locale=en-us&source=hmtagline


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


_________________________________________________________________
Search—Your way, your world, right now! http://imagine-windowslive.com/minisites/searchlaunch/?locale=en-us&FORM=WLMTAG


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

Reply via email to