views:

28

answers:

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.

+4  A: 

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
Cool, didn't know that.
Kyle