code: public static void parseQueryString( String str, Map res, String encoding )
      {
  
          // "Within the query string, the plus sign is reserved as
          // shorthand notation for a space. Therefore, real plus signs must
          // be encoded. This method was used to make query URIs easier to
          // pass in systems which did not allow spaces." -- RFC 1630
          int i = str.indexOf( '#' );
          if ( i > 0 )
          {
              str = str.substring( 0, i );
          }
          StringTokenizer st = new StringTokenizer( str.replace( '+', ' ' ), "&" );
  
          while ( st.hasMoreTokens() )
          {
              String qp = st.nextToken();
              String[] pair = qp.split( "=" );  // was String[] pair = StringUtils.split(qp, '=');
              //String s = unescape(pair[1], encoding);
              res.put( unescape( pair[0], encoding ), unescape( pair[1], encoding ) );
          }
      }
docs: Parses an RFC1630 query string into an existing Map.
  
  @param str      Query string
  @param res      Map into which insert the values.
  @param encoding Encoding to be used for stored Strings