if (!this.seenQuestionMark) { this.url.append('?'); this.seenQuestionMark = true;
if (v instanceof Collection) { addParameter(name, ((Collection) v).toArray()); } else if (v.getClass().isArray()) { addParameter(name, (Object[]) v);
    public void addParameter(String name, Object... values) {        try {            // Do a little special case checking to see if we were really passed            // a collection instead of one or more scalar values            if (values != null && values.length == 1 && values[0] instanceof Collection) {                values = ((Collection) values[0]).toArray();            }            // If values is null or empty, then simply sub in a single empty string            if (values == null || values.length == 0) {                values = Literal.array("");            }            for (Object v : values) {                // Figure out whether we already have params or not                if (!this.seenQuestionMark) {                    this.url.append('?');                    this.seenQuestionMark = true;                }                else {                    this.url.append(this.parameterSeparator);                }                this.url.append(name);                this.url.append('=');                if (v != null) {                    this.url.append( URLEncoder.encode(v.toString(), "UTF-8") );                }            }        }        catch (UnsupportedEncodingException uee) {            throw new StripesRuntimeException("Unsupported encoding?  UTF-8?  That's unpossible.");        }    }