How do I create a hash map?

Posted on 2004-11-19
Last Modified: 2010-05-18
If I have:

String server             = RequestParser.getString(request,"server", "nfsu2");
String platform       = RequestParser.getString(request,"platform", getPlatform());
String playername      = RequestParser.getString(request,"playername", "");
String error             = RequestParser.getString(request,"error", "unknown");

which gets the request.parameter of server, platform etc.

I want to store these in a hash map and then pull out the error value in the page and compare it to a string. How do I do this?
Question by:894359
    1 Comment
    LVL 8

    Accepted Solution

    just use
    HashMap map = new HashMap();
    dataMap.put(server, server);
    dataMap.put(platform      , platform      );
    dataMap.put(playername     , playername     );
    dataMap.put(error           , error           );



    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    David Varnum recently wrote up his impressions of PRTG, based on a presentation by my colleague Christian at Tech Field Day at VMworld in Barcelona. Thanks David, for your detailed and honest evaluation!
    Local Continuous Replication is a cost effective and quick way of backing up Exchange server data. The following article describes the steps required to configure Local Continuous Replication. Also, the article tells you how to restore from a backup…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now