public static long parseLongParam(ServletRequest request, String param)
      throws IOException {
    String paramStr = request.getParameter(param);
    if (paramStr == null) {
      throw new IOException("Invalid request has no " + param + " parameter");
    }
    
    return Long.valueOf(paramStr);
  }
public static long parseLongParam ( ServletRequest request , String param ) throws IOException { String paramStr = request . getParameter ( param ) ; if ( paramStr == null ) { throw new IOException ( "Invalid request has no " + param + " parameter" ) ; } return Long . valueOf ( paramStr ) ; }
@return a long value as passed in the given parameter, throwing
an exception if it is not present or if it is not a valid number.