Re[2]: Wizards and Struts Validator

"Adrian Banks" <[email protected]> Thu, 5 Dec 2002 18:01:44 -0000
Newsgroups gmane.comp.web.mvc.devel
Message-ID <DEEKLEJMNLJLDFMCDCFNMEFECOAA.anb$mvc__3350.45551551065$1039116842@granta.co.uk>
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

------------------------ 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/