Here you can find the source of getUrlParameters(String url)
public static Map<String, LinkedList<String>> getUrlParameters(String url) throws Exception
//package com.java2s; //License from project: LGPL import java.net.URLDecoder; import java.util.HashMap; import java.util.LinkedList; import java.util.Map; public class Main { public static Map<String, LinkedList<String>> getUrlParameters(String url) throws Exception { Map<String, LinkedList<String>> params = new HashMap<String, LinkedList<String>>(); if (url == null) { return params; }/* w w w . j a v a 2 s . c o m*/ String query; String[] urlParts = url.split("\\?"); if (urlParts.length > 1) { query = urlParts[1]; } else if (url.indexOf("=") >= 0) { query = url; } else { query = ""; } for (String param : query.split("&")) { String pair[] = param.split("="); String key = URLDecoder.decode(pair[0], "UTF-8"); String value; if (pair.length > 1) { value = URLDecoder.decode(pair[1], "UTF-8"); } else { value = null; } LinkedList<String> values = params.get(key); if (values == null) { values = new LinkedList<String>(); params.put(key, values); } values.add(value); } return params; } }