Whoa. Even if you knew nothing about Struts, what do you think this
typecast and immediate return gives you:

>   DynaActionForm Form1 = (DynaActionForm) form;
>   return mapping.findForward("success");

Try to use the type that you are supposed to use:

<form-bean
        name="Form1"
        type="org.apache.struts.action.DynaActionForm" dynamic="true">
        <form-property name="custName" type="java.lang.String"/>
</form-bean>

also use <html:form> around your table, because <html:text> builds an
input element of an HTML form (you may need it for input later) and
because Struts implicitly refers to action form that corresponds to
the action that is referenced in <html:form> tag. It is easier to use
"name" attribute in your input controls like:

<html:text name="Form1" property="custName" size="40"
styleClass="invisibleInput" readonly="true" tabindex="-1"/>

Try to search the Net for DynaActionForm for a change. There are
plenty of examples around.

Michael.

On 11/15/05, fea jabi <[EMAIL PROTECTED]> wrote:
> sorry, if I am not clear enough in my posts
>
> For now I am just just trying to lauch the jsp with all blank values.
>
> I am using dynaform beans.
>
>
> <form-bean
>         name="Form1"
>         type="com.formbeans.Form1" dynamic="true">
>         <form-property name="custName" type="java.lang.String"/>
> </form-bean>
>
> <tr>
>                     <td>
>                         <bean:message key="lbl.customername"/> <bean:message
> key="colon"/>
>                     </td>
>                     <td>
>                         <html:text property="custName" size="40"
> styleClass="invisibleInput" readonly="true" tabindex="-1"/>
>                     </td>
>                     <td></td>
>                 </tr>
>
>
> PrepareForm1Action class has ---
> public ActionForward execute(ActionMapping mapping,
>                                ActionForm form,
>                                HttpServletRequest request,
>                                HttpServletResponse response)
>                        throws ServletException, IOException{
>   DynaActionForm Form1 = (DynaActionForm) form;
>   return mapping.findForward("success");
>      }
>
> <action
>         path="/PrepareForm1Action"
>         type="com.actions.PrepareForm1Action"
>         name="Form1"
>         scope="session"
>         validate="false"
>         input="/pages/Form1.jsp">
>         <forward name="success" path="/pages/Form1.jsp" redirect="false"/>
>      </action>
>
>
> I am getting error
> javax.servlet.ServletException: No getter method for property custName of
> bean org.apache.struts.taglib.html.BEAN
>         
> org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:846)
>
>
> I do have to prepopulate my Jsp with some values later. To do this where do
> I have to write?
> ModuleConfig moduleConfig =
> >RequestUtils.getModuleConfig(request,
> >getServlet().getServletContext());
> >     FormBeanConfig formConfig =
> >
> >moduleConfig.findFormBeanConfig("your_form_name");
> >     DynaActionFormClass dynaClass =
> >
> >DynaActionFormClass.createDynaActionFormClass(formConfig);
> >
> >     try {
> >       myForm = (DynaActionForm)
> >dynaClass.newInstance();
> >     }
> >     catch (Exception e) {
> >       logger.error(e);
> >     }
>
>
>
> Thanks.
>
> >From: Richard Yee <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" <user@struts.apache.org>
> >To: Struts Users Mailing List <user@struts.apache.org>
> >Subject: Re: initialize dynaform
> >Date: Mon, 14 Nov 2005 13:10:15 -0800 (PST)
> >
> >Fea,
> >To initialize a dynaform staticly, do as Niall
> >suggested. To dynamically pre-populate a dynaform, you
> >need code to do it as follows:
> >
> >     ModuleConfig moduleConfig =
> >RequestUtils.getModuleConfig(request,
> >getServlet().getServletContext());
> >     FormBeanConfig formConfig =
> >
> >moduleConfig.findFormBeanConfig("your_form_name");
> >     DynaActionFormClass dynaClass =
> >
> >DynaActionFormClass.createDynaActionFormClass(formConfig);
> >
> >     try {
> >       myForm = (DynaActionForm)
> >dynaClass.newInstance();
> >     }
> >     catch (Exception e) {
> >       logger.error(e);
> >     }
> >
> >
> >Regards,
> >
> >Richard
> >
> >
> >--- fea jabi <[EMAIL PROTECTED]> wrote:
> >
> > > Is it possible to initialize dynaform?
> > >
> > > and how can this be done?
> > >
> > > Thanks.

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

Reply via email to