You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by fea jabi <zy...@hotmail.com> on 2005/11/16 15:52:03 UTC
No getter method servlet Exception. using DynaActionForm
I am trying to use the DynaActionForm.
<form-bean
name="CustForm"
type="org.apache.struts.action.DynaActionForm" dynamic="true">
<form-property name="custName" type="java.lang.String"/>
<form-property name="typeName" type="java.lang.String"/>
<form-property name="typeNameDesc" type="java.lang.String"/>
<form-property name="confirm" type="java.lang.boolean"
initial="true"/>
</form-bean>
<action
path="/PrepareCustAction"
type="com.actions.PrepareCustAction"
name="SetupForm"
scope="session"
validate="false"
input="/pages/Setup.jsp">
<forward name="success" path="/pages/Cust.jsp" redirect="false"/>
</action>
public class PrepareCustAction extends Action {
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException{
DynaActionForm setupForm = (DynaActionForm) form;
ModuleConfig moduleConfig = RequestUtils.getModuleConfig(request,
getServlet().getServletContext());
FormBeanConfig formConfig =
moduleConfig.findFormBeanConfig("CustForm");
DynaActionFormClass dynaClass =
DynaActionFormClass.createDynaActionFormClass(formConfig);
try {
setupForm = (DynaActionForm)dynaClass.newInstance();
}
catch (Exception e) {
//logger.error(e);
}
return mapping.findForward("success");
}
<html:form action="PostCust.do" method="post">
<table >
..................................
...................................
<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>
<tr></tr><tr></tr><tr></tr>
<tr>
<td>
<bean:message key="lbl.typename"/> <bean:message
key="colon"/>
</td>
<td>
<html:text property="typeName" size="40" />
</td>
<td></td>
</tr>
<tr></tr><tr></tr><tr></tr>
<!-- 3. Run Name Description -->
<tr>
<td>
<bean:message key="lbl.typenamedescption"/>
<bean:message key="colon"/>
</td>
<td>
<html:textarea property="typeNameDesc" />
</td>
<td></td>
</tr>
<tr></tr><tr></tr><tr></tr>
<tr>
<td>
<bean:message key="lbl.confirm"/> <bean:message
key="colon"/>
</td>
<td>
<html:checkbox property="confirm" />
</td>
<td></td>
</tr>
.........................
...........................
</table>
I am just trying to launch the jsp. Later would like to prepopulate the
formbean too.
But when when trying to lauch the jsp getting the below 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)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
what am I missing?
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: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org