tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gabriel Belingueres <>
Subject ClassCastException when changing from HashMap to TreeMap
Date Fri, 17 Oct 2008 14:48:50 GMT


I was accessing a Map<Integer, MyClass> implemented with a HashMap<Integer,
MyClass> from JSTL (v.1.1.2) using the following expression:

${map[param.myid].name} and it worked well.

However, when I changed the implementation to a TreeMap<Integer, MyClass>
the expression stop working because it throws ClassCastException saying that
can't compare Strings with Integers.

I know that ${param.myid} should resolve to a String, but I wanted to
clarify if this is a normal behaviour or it is a bug, since it seems to be
converting to Integer for HashMap but not for TreeMap.

Best regards,

View this message in context:
Sent from the Taglibs - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message