Re[2]: Wizards and Struts Validator

"Adrian Banks" <[email protected]>
Newsgroups gmane.comp.java.mvc.devel
Message-ID <[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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.