5 Replies Latest reply on Oct 26, 2002 7:14 PM by Julian Gosnell

    HttpServletRequest.getParameterMap ClassCastException

    dharma Newbie

      When I use HttpServletRequest.getParameterMap to get all params and then try to call (String)map.get("String"),
      it is giving ClassCastException.

      Here is the code:

      (HttpServletRequest request)
      Map parameters = request.getParameterMap();
      Iterator it = parameters.keySet().iterator();
      String param = (String)it.next();
      System.out.println(param + ":= " + (String)parameters.get(param));

      18:06:35,671 WARN [RequestProcessor] Unhandled Exception thrown: class java.lang.ClassCastException