tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <>
Subject RE: Using ParameterMap throws ClassCastException
Date Tue, 16 Sep 2003 14:23:58 GMT

Terrible idea.  Don't use tomcat internal classes.  Stick to the
interface defined by the spec, whereby
HttpServletRequest#getParameterMap returns an instance java.util.Map.

Yoav Shapira
Millennium ChemInformatics

>-----Original Message-----
>From: Morten Andersen []
>Sent: Tuesday, September 16, 2003 10:14 AM
>Subject: Using ParameterMap throws ClassCastException
>I am using the ParameterMap in request in an authentication mechanism.
>Therefore I need to do the following:
>add a mapping of parameters to the request.getParameter(). I do the
>import org.apache.catalina.util.ParameterMap;
>           System.out.println("ParameterMap is a: "+
>             try{
>                 ParameterMap map =
>                 map.setLocked(false);
>                 map.putAll(values.getParameterMap());
>                 map.setLocked(true);
>             }catch(Exception e){
>                 e.printStackTrace();
>             }
>This gives the following output:
>ParameterMap is a org.apache.catalina.util.ParameterMap
>And a ClassCastException in this line:
>             ParameterMap map =
>So it seems that they reference to two different class-definitions, but
>am using the same catalina.jar everywhere. (included it in the
>If I put catalina.jar in the WEB-INF/lib dir, then the above error is
>reported, else a ClassNotFoundException is thrown.
>I'm using tomcat-4.1 and found the class in the catalina.jar file.
>else is it?
>Morten Andersen
>Master of applied mathematics and computer science
>Research assistant (in e-learning)
>The Maersk Institute of Production technology at Southern Danish
>Campusvej 55
>DK-5230 Odense M
>+45 6550-3654
>+45 6171-1103
>Jabber id:

This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.

View raw message