It's not a secret anymore!
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 Make it so: Java DB Connections & Transactions this week in the JDBC 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
jQuery in Action, 3rd edition