This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
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 OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 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?
It is sorta covered in the JavaRanch Style Guide.
subject: [JSTL/EL] Dynamic key (String) to Map
It's not a secret anymore!