struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Saul Q Yuan" <y...@dataanvil.com>
Subject RE: Problem with struts validator
Date Wed, 07 Apr 2004 16:03:49 GMT
One thing I noticed is you're missing the argument for the required
message, ie.
<arg0 key="......" resource="true/false" /> in your validation.xml file.


> -----Original Message-----
> From: Marco Mistroni [mailto:mmistroni@waersystems.com] 
> Sent: Wednesday, April 07, 2004 11:57 AM
> To: 'Struts Users Mailing List'
> Subject: RE: Problem with struts validator
> 
> 
> Yes....
> I have also done some modifications, to try to write my own 
> validate method, and it gets called successfully. I made my 
> form extends DynaValidatorForm ,  I am calling super.validate 
> as well as doing some processing afterwards.. Well, It seems 
> that super.validate results in nothing...
> 
> I have no clue on what is going on..
> 
> Any hints?
> 
> Regards
> 	marco
> 
> -----Original Message-----
> From: Saul Q Yuan [mailto:yuan@dataanvil.com] 
> Sent: 07 April 2004 16:51
> To: 'Struts Users Mailing List'
> Subject: RE: Problem with struts validator
> 
> A quick question, have you set validate="true" in your action mapping?
> 
> Saul
> 
> > -----Original Message-----
> > From: Marco Mistroni [mailto:mmistroni@waersystems.com]
> > 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:z.khabot@ced.mfie.gov.ma]
> > 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: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message