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