Ramadoss Chinnakuzhandai wrote:
yes....I should restrict the user to enter both fields i.e they should enter anyone of the fields and not both.

These option I think is to use the validate method in your ActionForm and then first call your validation framework and then do the check for the custom stuff you need to take care of....


public ActionErrors validate(ActionMapping mapping,
                                 HttpServletRequest request) {

        ServletContext application = getServlet().getServletContext();
        ActionErrors errors = new ActionErrors();

//parameter will tell it what validation to look at
String parameter = request.getParameter( mapping.getParameter() );


Validator validator = Resources.initValidator( parameter, this, application, request, errors, page);

        try {
            validatorResults = validator.validate();
        } catch (ValidatorException e) {
            log.error(e.getMessage(), e);
        }

//!! now do the custom stuff.. comparing the fields etc and add
//any more errors to errors
        

        return errors;
    }

--
Rick


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to