I want my request parameter map in my custom map like
Map<String, String> reqMap =(HashMap<String, String>)request.getParameterMap();
Above statement gives me following exception
java.lang.ClassCastException: java.util.Collections$UnmodifiableMap
Can any one guide me how can I get all request parameters in my custom map?
Don’t want to write for loop to get parameters one by one which cause me performance issue.
Of course, you may need to iterate through the map elements in your
putAll()implementation. Otherwise it is not possible.UPDATE:
Just saw your comment, Thai is easy then,
or, you can even pass the
reqMapas a constructor argument tonew HashMap<String, String>(reqMap);