I have a Hashmap and a set of keys. For each key, I want to perform a task depending on whether it is present in the hashmap. Can anyone show how to do this? I am using Struts and JSP in my application
This question is old, but have you tried something like this?
for (String key : setOfKeys) { if (hm.containsKey(key)) { doSomething(hm, key); } }