Is there anyway I can convert a Map to a POJO that I can then use in JSP EL? Maybe with reflection or something? I don't want to have to manually create a new class for every new collection of properties.
Asked
Active
Viewed 344 times
1
-
1Are you trying to access a map in JSTL? Because you can do that instead of turning it into a POJO - see some examples here: http://stackoverflow.com/questions/924451/jstl-access-a-map-value-by-key – Ben J Oct 15 '10 at 00:38
1 Answers
4
There's no need to do so. EL can perfectly access maps.
${map.key}
Or if the key contains dots:
${map['key.with.dots']}
You can even access it using dynamic keys:
${map[key]}

BalusC
- 1,082,665
- 372
- 3,610
- 3,555