File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes [JSTL/EL] Dynamic key (String) to Map Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "[JSTL/EL] Dynamic key (String) to Map" Watch "[JSTL/EL] Dynamic key (String) to Map" New topic

[JSTL/EL] Dynamic key (String) to Map

Saurabh Pillai
Ranch Hand

Joined: Sep 12, 2008
Posts: 524
Map<String,List<Object[]>> This map is passed to JSP.

I evaluate it in JSP like,

Now, above code does not get value for key from map map1. But if I change map key from String to Long, Map<Long,List<Object[]>> everything works fine.

After some googling I came across where it says, for example, 123456 evaluates to Long, but I eventough I have number I want it to be treated as String and I pass it as a String.

How can I do it?
I agree. Here's the link:
subject: [JSTL/EL] Dynamic key (String) to Map
It's not a secret anymore!