/** * Check if all required parameters are received in <code>request</code>. * * @param request HttpServletRequest to validate * @param state IState The restored state for this url * @param target Part of the url that represents the target action * @return valid result if all required parameters are received. False in otherwise. */ private ValidatorHelperResult allRequiredParametersReceived( HttpServletRequest request, IState state, String target) { Hashtable receivedParameters = new Hashtable(state.getRequiredParams()); String currentParameter = null; Enumeration requestParameters = request.getParameterNames(); while (requestParameters.hasMoreElements()) { currentParameter = (String) requestParameters.nextElement(); if (receivedParameters.containsKey(currentParameter)) { receivedParameters.remove(currentParameter); } // If multiple parameters are received, it is possible to pass this // verification without checking all the request parameters. if (receivedParameters.size() == 0) { return ValidatorHelperResult.VALID; } } if (receivedParameters.size() > 0) { this.logger.log( HDIVErrorCodes.REQUIRED_PARAMETERS, target, receivedParameters.keySet().toString(), null); return new ValidatorHelperResult(HDIVErrorCodes.REQUIRED_PARAMETERS); } return ValidatorHelperResult.VALID; }