public static int[] getIntParameters(HttpServletRequest request,
                                         String name, int defaultNum) {
        String[] paramValues = request.getParameterValues(name);
        if (paramValues == null || paramValues.length == 0) {
            return new int[0];
        }
        int[] values = new int[paramValues.length];
        for (int i = 0; i < paramValues.length; i++) {
            try {
                values[i] = Integer.parseInt(paramValues[i]);
            }
            catch (Exception e) {
                values[i] = defaultNum;
            }
        }
        return values;
    }
Returns a list of int parameters.

@param request the HttpServletRequest object, known as "request" in a
     JSP page.
@param name the name of the parameter you want to get
@param defaultNum the default value of a parameter, if the parameter
     can't be converted into an int.
@return an array of integers
xmppserver/src/main/java/org/jivesoftware/util/ParamUtils.java