1

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.

Kyle
  • 21,377
  • 37
  • 113
  • 200
  • 1
    Are 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 Answers1

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