The easiest way is probably to use the getQuery() from URL class and then parse the result returned by the getQuery(). For example:
To iterate the map, you can do this:
[ August 07, 2007: Message edited by: Freddy Wong ]
SCJP 5.0, SCWCD 1.4, SCBCD 1.3, SCDJWS 1.4
posted 13 years ago
I was a bit surprised the other day when I did getParameterMap().entrySet() from a J2EE Request object, the value in each entry is an array. That supports having the same key more than once in the query string. Think about whether you want to handle that.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
posted 11 years ago
Using request.getParameter("ubb") is significantly easier than iterating through the entire query string.
If, however, you have multiple possible values (which the query string supports, though rarely used) you would have to iterate through.
Joe Donahue wrote:If, however, you have multiple possible values (which the query string supports, though rarely used) you would have to iterate through.
Not correct on both counts. It is very common to have multiple parameters with the same name, and the getParameterValues() method gives them to you as an array without the need for dealing with the query string.