code: public String encodeAllParameters ()
      {
          StringBuilder buf = new StringBuilder();
          Enumeration<?> e = _req.getParameterNames();
          while (e.hasMoreElements()) {
              if (buf.length() > 0) {
                  buf.append('&');
              }
              String param = (String) e.nextElement();
              buf.append(StringUtil.encode(param));
              buf.append('=');
              buf.append(StringUtil.encode(_req.getParameter(param)));
          }
  
          return buf.toString();
      }
docs: Encodes all the request params so they can be slapped onto a different URL which is useful
  when doing redirects.