code: public static String appendParameter(String url, String paramName, String paramValue) {
  
          if (CmsStringUtil.isEmpty(url)) {
              return null;
          }
          int pos = url.indexOf(URL_DELIMITER);
          StringBuffer result = new StringBuffer(256);
          result.append(url);
          if (pos >= 0) {
              // url already has parameters
              result.append(PARAMETER_DELIMITER);
          } else {
              // url does not have parameters
              result.append(URL_DELIMITER);
          }
          result.append(paramName);
          result.append(PARAMETER_ASSIGNMENT);
          result.append(paramValue);
          return result.toString();
      }
docs: Appends a request parameter to the given URL.<p>
  
  This method takes care about the adding the parameter as an additional
  parameter (appending <code>&param=value</code>) or as the first parameter
  (appending <code>?param=value</code>).<p>
  
  @param url the URL where to append the parameter to
  @param paramName the paramter name to append
  @param paramValue the parameter value to append
  
  @return the URL with the given parameter appended