code: public static String encodeParams(HttpServletRequest req) {
  
          StringBuffer result = new StringBuffer(512);
          Map<String, String[]> params = CmsCollectionsGenericWrapper.map(req.getParameterMap());
          Iterator<Map.Entry<String, String[]>> i = params.entrySet().iterator();
          while (i.hasNext()) {
              Map.Entry<String, String[]> entry = i.next();
              String param = entry.getKey();
              String[] values = entry.getValue();
              for (int j = 0; j < values.length; j++) {
                  result.append(param);
                  result.append("=");
                  result.append(CmsEncoder.encode(values[j]));
                  if ((j + 1) < values.length) {
                      result.append("&");
                  }
              }
              if (i.hasNext()) {
                  result.append("&");
              }
          }
          return CmsEncoder.encode(result.toString());
      }
docs: Returns all parameters of the given request
  as a request parameter URL String, that is in the form <code>key1=value1&key2=value2</code> etc.
  
  The result will be encoded using the <code>{@link CmsEncoder#encode(String)}</code> function.<p>
  
  @param req the request to read the parameters from
  
  @return all initialized parameters of the given request as request parameter URL String