A quick question, have you set validate="true" in your action mapping?
Saul > -----Original Message----- > From: Marco Mistroni [mailto:[EMAIL PROTECTED] > Sent: Wednesday, April 07, 2004 11:31 AM > To: 'Struts Users Mailing List' > Subject: Problem with struts validator > > > Hi all, > I am experiencing problems with struts-validator, in > that it seems That the validation is not done at all. I have > created a form (named contactFomr) that extends DynaValidatorForm. > > <form-bean name="contactForm" > type="org.apache.struts.validator.DynaValidatorForm"> > <form-property name="contactRef" > type="java.lang.String"/> > <form-property name="contactName" > type="java.lang.String"/> > <form-property name="address1" > type="java.lang.String"/> > <form-property name="address2" > type="java.lang.String"/> > <form-property name="address3" > type="java.lang.String"/> > <form-property name="address4" > type="java.lang.String"/> > <form-property name="postcode" > type="java.lang.String"/> > <form-property name="fax" type="java.lang.String"/> > <form-property name="country" > type="java.lang.String"/> > <form-property name="emailAddress" > type="java.lang.String"/> > <form-property name="website" > type="java.lang.String"/> > <form-property name="telephohe" > type="java.lang.String"/> > <form-property name="version" > type="java.lang.Integer"/> > <form-property name="versionDate" > type="java.sql.Timestamp"/> > <form-property name="buttonSelected" > type="java.lang.String"/> > <form-property name="statusMessage" > type="java.lang.String"/> > </form-bean> > > > I have created a validation.xml file which contains following code > > <form-validation> > > > <!-- ========== Default Language Form Definitions > ===================== --> > <formset> > > <!-- Validation rules for Contact form. We need to check > only that contactRef is present > --> > <form name="contactForm"> > > <field property="contactRef" > depends="required,minlength"> > <var> > <var-name>minlength</var-name> > <var-value>5</var-value> > </var> > > <!-- > <msg > name="required" > key="message.00042"/>--> > </field> > > > </form> > > </formset> > > > </form-validation> > > > I have configured the plugIn In struts-config.xml , but > whenever I submit the form (not providing the field > contactRef) everything is fine and the form is submitted > (while I was expecting to receive an error displayed on my > Input page..) > > Anyone can help? > > Thanx in advance and regards > marco > > > > > > > > -----Original Message----- > From: Zakaria khabot [mailto:[EMAIL PROTECTED] > Sent: 07 April 2004 11:56 > To: Struts Users Mailing List; Struts Developers List > Subject: validation.xml > > Hi all, > > How to call the validator from an Action. > - in struts-config I put validate="false", > - I am using validation.xml to control erors. > - In the action I wrote : > ActionErrors errors = new ActionErrors(); > > errors = form.validate(mapping, request); > > but it executes the validate methode in the formAction not in > the validation.xml. > > > > Thanks for help... > > > > > --------------------------------------------------------------------- > 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]