code: public static String requireParameter (
          HttpServletRequest req, String name, String missingDataMessage, int maxLength)
          throws DataValidationException
      {
          return StringUtil.truncate(
              requireParameter(req, name, missingDataMessage), maxLength);
      }
docs: Fetches the supplied parameter from the request and ensures that it is no longer than
  maxLength.
  
  Note that use of this method could be dangerous. If the specified HttpServletRequest is used
  to pre-fill in values on a form, it will not know to use the truncated version. A user may
  enter a version that is too long, your code will see a truncated version, but then the user
  will see on the page again the full-length reproduction of what they typed in. Be careful.