You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by John Nicholas <ja...@mobosplash.com> on 2002/09/25 17:41:50 UTC

Validator and DynaValidatorForm

I'm using the DynaForm / Validator stuff for the first time, I've always
written out the Forms and Actions before. Everything seems in place but 
the Validator never catches an error and the submit always succeeds.

from struts-config.xml:

         <form-bean
             name="testbean"
             dynamic="true"
             type="org.apache.struts.validator.DynaValidatorForm">
             <form-property
                 name="tname"
                 type="java.lang.String"/>
             <form-property
                 name="tage"
                 type="java.lang.String"/>
             <form-property
                 name="tphone"
                 type="java.lang.String"/>
          </form-bean>
and
         <action
             path="/testformSubmit"
             name="testbean"
             type="ActionTest"
             input="/WEB-INF/jsp/testform.jsp"
             scope="request"
             parameter="test"
             validate="true" >
           <forward name="success" path="/pages/Welcome.jsp"/>
         </action>

and
   <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
     <set-property property="pathnames" 
value="/WEB-INF/validator-rules.xml,/WEB-INF/validator.xml" />
   </plug-in>



from validation.xml:
     <formset>
	<form name="testbean">
		<field property="tage" depends="required,integer">
		</field>
	</form>
     </formset>


I've tried various things in validation as far as changing up <arg0> 
settings. I'm very unclear on what the <arg#> settings are for though




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>