did you write validate=true in you action-mapping ? Andrew Close a �crit :
hi all,
i've been playing with 'Validator' for a couple of days now and can't quite get it to work. i've read the dev_validator.html on the Validator page and several of the links off that page. i've spent several hours reading through the mail archive (http://marc.theaimsgroup.com/?l=struts-user) to no avail. although there were some pretty interesting/funny discussions by a Mark G. who apparently doesn't like the Validator framework. :)
anyway, i'm not sure what i've set up incorrectly. my formbean extends ValidatorActionForm as i share the same form over several actions. i have the validator plugin in my struts-config and i can see the validator loading on startup. right now my validator.xml is very simple as i'm trying to get only one field validated:
<?xml version="1.0" encoding="UTF-8"?> <form-validation> <formset> <form name="/addItemsResult"> <field property="nbrOfItms" depends="required, integer, intRange"> <arg0 key="nbrOfItms" resource="false" /> <arg1 name="intRange" key="${var:min}" resource="false"/> <arg1 name="intRange" key="${var:max}" resource="false"/> <var> <var-name>min</var-name> <var-value>1</var-value> </var> <var> <var-name>max</var-name> <var-value>10</var-value> </var> </field> </form></formset></form-validation>
my validator-rules.xml is the standard, no changes.
and in my JSP's form i have:
<td align="left" class="Prompt1">
Please Enter the number of Non-Member items you would like to add: <html:text property="nbrOfItms" maxlength="2" size="2" />
</td>
now my understanding was that when the /addItemsResult action was called that my fields would be validated. as i step through the debugger i never enter any struts code. does this get validated before my action class is called? or am i supposed to make a call myself? where am i making my mistake? any pointers would be greatly appreciated.
thanks, andy
--------------------------------------------------------------------- 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]

