Over a million developers have joined DZone.

Retrieving All Parameters to a Java Servlet

DZone's Guide to

Retrieving All Parameters to a Java Servlet

Here's a really simple code snippet for retrieving parameters to a Java servlet.

· Java Zone
Free Resource

The single app analytics solutions to take your web and mobile apps to the next level.  Try today!  Brought to you in partnership with CA Technologies

    Map params = request.getParameterMap();
    Iterator i = params.keySet().iterator();

    while ( i.hasNext() )
        String key = (String) i.next();
        String value = ((String[]) params.get( key ))[ 0 ];

CA App Experience Analytics, a whole new level of visibility. Learn more. Brought to you in partnership with CA Technologies.

java ,java servlet

Opinions expressed by DZone contributors are their own.


Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.


{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}