> -----Original Message----- > From: lnader2000 [mailto:[EMAIL PROTECTED] > Sent: Tuesday, August 03, 2004 10:36 AM > To: [EMAIL PROTECTED] > Subject: On post ActionForm is null > > > I have a simple form show below: > > <jsp:useBean id="tranDefForm" > class="com.company.web.forms.TranDefForm"/>
Don't need the jsp:useBean... it's probably hiding the form your declaring in the strutsconfig file. from http://struts.apache.org/userGuide/struts-html.html#form comes the why: The form bean is located, and created if necessary, based on the form bean specification for the associated ActionMapping. > > <form action='/web/tranDefDetail.do' method='POST'> > <html:hidden name="tranDefForm" property="id"/> > <html:text name="tranDef" property="name" /> > <html:submit property="method">Save</html:submit> > <html:submit property="method">Delete</html:submit> > </form> > > This is how I have defined it in the struts-config file > > <form-bean name="TranDefForm" type="com.company.we > b.forms.TranDefForm" /> > > <action path="/tranDefDetail" parameter="method" > type="com.company.web.actions.TranDefActions" name="TranDefForm" > validate="true"> > <forward name="success" path="/admin/tran-def-detail.jsp" > redirect="false" /> > <forward name="failure" path="/admin/tran-def-detail.jsp" > redirect="false" /> > </action> > > When I load the page it seems to work fine and call the appropriate > setter and getter methods in my ActionForm class. But when I click on > Save to submit the form, it bypasses the setting of the ActionForm > properties and goes straight to the execute method of my action class > with the "ActionForm form" parameter passed as null. > > What am I doing wrong??? > > -Lili > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]