Retrieving All Parameters to a Java Servlet
Here's a really simple code snippet for retrieving parameters to a Java servlet.
Join the DZone community and get the full member experience.
Join For Free
Map params = request.getParameterMap();
Iterator i = params.keySet().iterator();
while ( i.hasNext() )
{
String key = (String) i.next();
String value = ((String[]) params.get( key ))[ 0 ];
}
Java (programming language)
Opinions expressed by DZone contributors are their own.
Comments