code: public static int getIntParameter(final ServletRequest pReq, final String pName, final int pDefault) {
          String str = pReq.getParameter(pName);
  
          try {
              return str != null ? Integer.parseInt(str) : pDefault;
          }
          catch (NumberFormatException nfe) {
              return pDefault;
          }
      }
docs: Gets the value of the given parameter from the request converted to
  an {@code int}.&nbsp;If the parameter is not set or not parseable, the default
  value is returned.
  
  @param pReq     the servlet request
  @param pName    the parameter name
  @param pDefault the default value
  @return the value of the parameter converted to an {@code int}, or the default
  value, if the parameter is not set.