code: public Map<String,Object> getRequestProperties(HttpServletRequest req, boolean bIncludeURL)
      {
          Map<String,Object> propOut = new Hashtable<String,Object>();
          Map<?,?> properties = req.getParameterMap();
          for (Map.Entry<?,?> entry : properties.entrySet())
          {
              String strKey = (String)entry.getKey();
              String strValue = req.getParameter(strKey);
              propOut.put(strKey, strValue);
          }
          
          if (bIncludeURL)
          {
              String strURL = req.getRequestURL().toString();
              if (strURL != null)
              {
                  propOut.put(DBParams.URL, strURL);
                  propOut.put(DBParams.DOMAIN, Utility.getDomainFromURL(strURL, null));  // Program will probably need domain name
                  String strCodeBase = Utility.getDomainFromURL(strURL, req.getContextPath(), true);
                  if (strCodeBase == null)
                      strCodeBase = DBConstants.BLANK;
                  else if (!strCodeBase.startsWith("http://"))
                      strCodeBase = "http://" + strCodeBase;
                  propOut.put(DBParams.BASE_URL, Utility.encodeXML(strCodeBase)); // I don't call it DBParams.CODEBASE, because it is often passed as parameter
              }
          }
  
          return propOut;
      }
docs: Get all the parameters passed in the URL or POST as a properties object.
  NOTE: Remember to URLDecoder.decode if the data was encoded (Should have been!)
  @param bIncludeURL Include the URL as a baseURL property?
  @return The properties.