1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| public class BaseForm extends ValidatorActionForm {
public String getValidationKey(ActionMapping mapping, HttpServletRequest request)
{
String dispatch = request.getParameter("dispatch");
if (StringUtils.isEmpty(dispatch)) {
// Le dispatch n'est pas defini VALIDATOR standard
return mapping.getAttribute();
}
// Le dispatch est definit construction de la cle
// avec le dispatch pour rechercher dans validation.xml
// le form :
// <form name="myPath?dispatch=..."
return mapping.getAttribute() + "?dispatch=" + dispatch;
}
} |