code: public static StringBuilder createQueryStringFromMap(Map m, String ampersand) {
  		StringBuilder aReturn = new StringBuilder("");
  		Set aEntryS = m.entrySet();
  		Iterator aEntryI = aEntryS.iterator();
  
  		while (aEntryI.hasNext()) {
  			Map.Entry aEntry = (Map.Entry) aEntryI.next();
  			Object o = aEntry.getValue();
  
  			if (o == null) {
  				append(aEntry.getKey(), "", aReturn, ampersand);
  			} else if (o instanceof String) {
  				append(aEntry.getKey(), o, aReturn, ampersand);
  			} else if (o instanceof String[]) {
  				String[] aValues = (String[]) o;
  
  				for (int i = 0; i < aValues.length; i++) {
  					append(aEntry.getKey(), aValues[i], aReturn, ampersand);
  				}
  			} else {
  				append(aEntry.getKey(), o, aReturn, ampersand);
  			}
  		}
  
  		return aReturn;
  	}
docs: Builds a query string from a given map of parameters
  
  @param m
  A map of parameters
  @param ampersand
  String to use for ampersands (e.g. "&" or "&amp;" )
  
  @return query string (with no leading "?")