oh............ I found that my implementation will let user skip my validation and directly execute the action.........
----- Original Message ----- From: "Justy Wong" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Tuesday, October 19, 2004 1:48 PM Subject: Re: validation question > Thanks!!! I tried your last suggestion and it works fine!!! > > public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest > httpServletRequest) { > if (getCheck()==null) { > return null; > } else { > return super.validate(actionMapping, httpServletRequest); > } > } > > > > ----- Original Message ----- > From: "Joe Hertz" <[EMAIL PROTECTED]> > To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]> > Sent: Tuesday, October 19, 2004 11:43 AM > Subject: RE: validation question > > > > > Joe, do u mean checking the field with "validwhen" using > > > validation.xml or > > > implement the actionForm.validate() ? > > > I really want to use the basic struts validation framework instead of > > > implementing validate() function to minimize the maintainence cost. > > > > > > You can do it both ways. > > > > Use validation.xml, but ALSO define your own validate() that checks the > > "should I validate property". > > > > All you have to do to get the validation framework to do it's thing is to > > call super.vallidate() in your own validate() method. > > > > -Some Other Joe > > > > > > > > --------------------------------------------------------------------- > > 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]