@Override protected void addParameter(String key, String value) { if ((key == null) || (key.length() == 0)) { throw new IllegalArgumentException("the argument key must not be null or empty!"); } if (value == null || value.length() == 0) { params.removeParameter(key); } else { String[] arrayVals = params.getValues(key); if (arrayVals != null) { List<String> vals = new ArrayList<String>(Arrays.asList(arrayVals)); vals.add(value); params.setValues(key, vals.toArray(new String[0])); } else { params.setValue(key, value); } } }
protected void addRenderParameter(String key, String value) { if ((key == null) || (key.length() == 0)) { throw new IllegalArgumentException("the argument key must not be null or empty!"); } if (value == null || value.length() == 0) { rparams.removeParameter(key); } else { String[] arrayVals = rparams.getValues(key); if (arrayVals != null) { List<String> vals = new ArrayList<String>(Arrays.asList(arrayVals)); vals.add(value); rparams.setValues(key, vals.toArray(new String[0])); } else { rparams.setValue(key, value); } } }