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.
>
>
_________________________________________________________________
> Express yourself instantly with MSN Messenger!
> Download today - it's FREE!
>
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>
>
__________________________________
Start your day with Yahoo! - Make it your home page!
http://www.yahoo.com/r/hs
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]