code: public static int requireIntParameter (HttpServletRequest req, String name,
                                             String invalidDataMessage, ParameterValidator validator)
          throws DataValidationException
      {
          String value = getParameter(req, name, false);
          validator.validateParameter(name, value);
          return parseIntParameter(value, invalidDataMessage);
      }
docs: Fetches the supplied parameter from the request and converts it to an integer. If the
  parameter does not exist or is not a well-formed integer, a data validation exception is
  thrown with the supplied message.