If you areHow about using Servlets/JSP , you can use"getQuery()" to retrieve the following ServletRequest APIQuery String.
String query = url.getQuery(); This will work for GET and POSTgive you the the query part of this URL.
getParameterMapUse StringTokenizer to separate the parameters. (You will have to apply StringTokenizer twice.)
First get tokens from query string which are separated by "&". This will return "val1=5" , getParameterNames "val4=1500", getParameterValues etc.
TheTo the above tokens apply StrinTokenizer once again. This time retrieve tokens separated by the "=". Now iterate through this, the first token will returnbe the parameters that are passed in an URLparameter name "val4", the second token will be the value "1500".
StringTokenizer st = new StringTokenizer(query,"&",false); //query is from getQuery() while (st.hasMoreElements()) { // First Pass to retrive the "parametername=value" combo String paramValueToken = st.nextElement().toString(); StringTokenizer stParamVal = new StringTokenizer(paramValueToken, "=", false ); int i = 0; while (stParamVal.hasMoreElements()) { //Second pass to separate the "paramname" and "value". // 1st token is param name // 2nd token is param value String separatedToken = stParamVal.nextElement().toString(); if( i== 0) { //This indicates that it is the param name : ex val4,val5 etc String paramName = separatedToken; } else { // This will hold value of the parameter String paramValue = separatedToken; } i++; } } API documentationURL getQuery() API Documentation
http://download.oracle.com/javaee/6/api/javax/servlet/ServletRequest.html#getParameterNames()http://download.oracle.com/javase/1.4.2/docs/api/java/util/StringTokenizer.html