code: public int intVal(String newVal, int curVal, String name) {
      int newInt;
  
      try {
        newInt = Integer.parseInt(newVal);
      } catch (Exception e) {
        valErrors.add(new IntValError(name, newVal));
        newInt = curVal;
      }
  
      return newInt;
    }
docs: Convert a string parameter so we can add an
  error message for incorrect formats (instead of relying on Struts).
  
  <p>Struts tends to return 0 or null for illegal values, e.g., alpha
  characters for a number.
  
  @param newVal
  @param curVal
  @param name
  @return String