public static String getQueryString(final HttpServletRequest request, final char prefix, final String... additionalFormFields) {
        final StringBuilder sb = new StringBuilder();
        char conjunction = prefix;
        final int currentPage = ParamUtils.getIntParameter(request, REQUEST_PARAMETER_KEY_CURRENT_PAGE, 1);
        if (currentPage > 1) {
            sb.append(conjunction)
                .append(String.format("%s=%d", REQUEST_PARAMETER_KEY_CURRENT_PAGE, currentPage));
            conjunction = '&';
        }
        final int pageSize = bound(ParamUtils.getIntParameter(request, REQUEST_PARAMETER_KEY_PAGE_SIZE, DEFAULT_PAGE_SIZE), PAGE_SIZES[PAGE_SIZES.length - 1]);
        if (pageSize != DEFAULT_PAGE_SIZE) {
            sb.append(conjunction)
                .append(String.format("%s=%d", REQUEST_PARAMETER_KEY_PAGE_SIZE, pageSize));
            conjunction = '&';
        }
        for (final String additionalFormField : additionalFormFields) {
            final String formFieldValue = ParamUtils.getStringParameter(request, additionalFormField, "").trim();
            if(!formFieldValue.isEmpty()) {
                String encodedValue;
                encodedValue = URLEncoder.encode(formFieldValue, StandardCharsets.UTF_8);
                sb.append(conjunction)
                    .append(String.format("%s=%s", additionalFormField, encodedValue));
                conjunction = '&';
            }
        }
        return sb.toString();
    }
@param request The request to retrieve the values from
@param prefix The first char of the query string - either `?` or `&amp;`
@param additionalFormFields 0 or more form field names to include in requests for other pages
@return a query string required to maintain the current list pager state
xmppserver/src/main/java/org/jivesoftware/util/ListPager.java