/* 根据map解析成 name=wangc&age=25 的格式, */
public static String transMapToString(Map map,String diff,String split){
    diff = "".equals(diff)||null==diff?"=":diff;
    split = "".equals(split)||null==split?"&":split;
    java.util.Map.Entry entry;
    StringBuffer sb = new StringBuffer();
    for(Iterator iterator = map.entrySet().iterator(); iterator.hasNext();)
    {
        entry = (java.util.Map.Entry)iterator.next();
        sb.append(entry.getKey().toString()).append( diff ).append(null==entry.getValue()?"":
                entry.getValue().toString()).append (iterator.hasNext() ? split : "");
    }
    return sb.toString();
}

参考:http://blog.csdn.net/ziwen00/article/details/7976144