code: public static String encodeParamsWithUri(String uri, HttpServletRequest req) {
  
          String result;
          String params = encodeParams(req);
          if (CmsStringUtil.isNotEmpty(params)) {
              result = CmsEncoder.encode(uri + "?") + params;
          } else {
              result = CmsEncoder.encode(uri);
          }
          return result;
      }
docs: Encodes the given URI, with all parameters from the given request appended.<p>
  
  The result will be encoded using the <code>{@link CmsEncoder#encode(String)}</code> function.<p>
  
  @param req the request where to read the parameters from
  @param uri the URI to encode
  @return the encoded URI, with all parameters from the given request appended