Here you can find the source of splitQuery(String url)
public static Map<String, String> splitQuery(String url) throws UnsupportedEncodingException
//package com.java2s; //License from project: Open Source License import java.io.UnsupportedEncodingException; import java.net.MalformedURLException; import java.net.URL; import java.net.URLDecoder; import java.util.LinkedHashMap; import java.util.Map; public class Main { public static Map<String, String> splitQuery(String url) throws UnsupportedEncodingException { URL myURL = null;//from w ww . j a v a 2 s . c o m try { myURL = new URL(url); } catch (MalformedURLException e) { // TODO Auto-generated catch block e.printStackTrace(); } Map<String, String> query_pairs = new LinkedHashMap<String, String>(); String query = myURL.getQuery(); String[] pairs = query.split("&"); for (String pair : pairs) { int idx = pair.indexOf("="); query_pairs.put(URLDecoder.decode(pair.substring(0, idx), "UTF-8"), URLDecoder.decode(pair.substring(idx + 1), "UTF-8")); } return query_pairs; } }