Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 235
  • Last Modified:

How do I create a hash map?

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?
0
894359
Asked:
894359
1 Solution
 
kiranhkCommented:
just use
HashMap map = new HashMap();
dataMap.put(server, server);
dataMap.put(platform      , platform      );
dataMap.put(playername     , playername     );
dataMap.put(error           , error           );


then

dataMap.get(error);
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now