ClassCastException when changing from HashMap to TreeMap
Gabriel Belingueres <[email protected]> Fri, 17 Oct 2008 07:48:50 -0700 (PDT)
| Newsgroups | gmane.comp.jakarta.taglibs.user |
|---|---|
| Message-ID | <[email protected]> |
Hi,
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,
Gabriel
--
View this message in context: http://www.nabble.com/ClassCastException-when-changing-from-HashMap-to-TreeMap-tp20034818p20034818.html
Sent from the Taglibs - User mailing list archive at Nabble.com.