You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by sledge <si...@gmail.com> on 2009/02/24 12:00:01 UTC
[SOLVED] Re: DynaValidatorForm arrives as null (that of passed by
ActionForm) in execute
Problem solved: I was using a wrong type in form-properties:
java.lang._b_oolean
sledge wrote:
>
> Struts 1.1; There's something I think I am doing not right.. Here is the
> code:
>
> action .java:
> public class EditColActionInit extends Action {
> public ActionForward execute(ActionMapping mapping, ActionForm form,
> HttpServletRequest request, HttpServletResponse response)
> throws Exception {
>
> // form arrives as null
> DynaValidatorForm myForm = (DynaValidatorForm) form;
> }
>
> struts-config:
> <form-bean name="newRunVer2EditColForm"
> type="org.apache.struts.validator.DynaValidatorForm">
> <form-property name="label" type="java.lang.String"/>
> </form-bean>
> ...
> <action path="/NewRunVer2/editColInit"
> type="webfabis.newRunVer2.controller.EditColActionInit"
> name="newRunVer2EditColForm"
> scope="request"
> validate="true"
> input="/NewRunVer2/editCol.jsp">
>
> <forward name="failure" path="/mainMenu.jsp"/>
> <forward name="success" path="/NewRunVer2/editCol.jsp"/>
> </action>
> ...
> <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
> <set-property property="pathnames"
>
> value="/webfabis/defaultroot/WEB-INF/validator-rules.xml,
> /WEB-INF/validation.xml"/>
> <set-property property="stopOnFirstError" value="false"/>
> </plug-in>
> ...
> validation.xml:
> <form-validation>
>
> <formset>
> <form name="newRunVer2EditColForm">
> <field property="label" depends="required"/>
> </formset>
> </form-validation>
> ...
> editCol.jsp:
>
> <%@ page contentType="text/html;charset=UTF-8" language="java" %>
> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
>
> <html:html locale='true'>
> <HEAD>
> <TITLE>EditCol Program</TITLE>
> <link rel="stylesheet" type="text/css" media="screen"
> href="/style/style.css" />
> </HEAD>
> <body class='middler'>
> <html:form action="/NewRunVer2/editCol.do" focus="label"
> style="background:white;" onsubmit="return
> validateNewRunVer2EditColForm(this)">
> <table style="vertical-align: middle">
> <tr>
> <th align="right">Label:</th>
> <td>
> <html:text name="newRunVer2EditColForm" property="label"/></td>
> </tr>
> </table>
> <html:submit disabled="false" property="submitButton"
> value="Update"/>
> <html:javascript formName="NewRunVer2EditColForm" />
> </html:form>
> </body>
> </HTML>
> </html:html>
>
>
> pls help.!
>
> --
> sledge
>
--
View this message in context: http://www.nabble.com/DynaValidatorForm-arrives-as-null-%28that-of-passed-by-ActionForm%29-in-execute-tp22159345p22179785.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org