Re: Re[2]: Wizards and Struts Validator

Steve Leung <[email protected]> Fri, 6 Dec 2002 10:50:17 +0800 (CST)
Newsgroups gmane.comp.web.mvc.devel
Message-ID <[email protected]>
Hi Adrian,
  If I use DynaValidatorForm, do I need to implement
sub-class of it and override the validate method to do
such check ?
  Do you know is there a way for me to define one form
but has two validation rule based on different action
I forward to ?
  Thx,
 Steve

 --- Adrian Banks
<[email protected]> 的郵件內容:>
You can do this by assigning a parameter to the
> action in the
> struts-config.xml file :
> 
>         <action path="/myAction"
>                 type="className"
>                 parameter="step1"
>                 name="filterInput"
>                 scope="request">
> 
> You can then get hold of this parameter in the
> validate method of the action
> form bean :
> 
>     public ActionErrors validate(ActionMapping
> mapping, HttpServletRequest
> request)
>     {
>         String parameter = mapping.getParameter();
> 
>         .....
>     }
> 
> You can then validate different things based on the
> value of the parameter,
> allowing you to use the same common bean for
> different actions by having a
> different parameter per action.
> 
> Adrian
> 
> _______________________________________________
> MVC-Programmers mailing list
> [email protected]
>
http://www.netbean.net/mailman/listinfo/mvc-programmers
>  

_________________________________________________________
女人之苦(許志安),笑中有淚(楊千嬅),愛不釋手(李克勤)...
Over 800 latest ringtones, only on Yahoo!
http://ringtone.yahoo.com.hk

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get 128 Bit SSL Encryption!
http://us.click.yahoo.com/CBxunD/vN2EAA/xGHJAA/NhFolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
[email protected]

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/