Is there any way to call toString() on an object with the EL and JSTL? (I need the String representation of an enum as index in a map in a JSP EL expression.) I hoped something like ${''+object}
would work like in java, but EL isn't that nice, and there does not seem to be any function that does it.
Clarification: I have a variable somemap
that maps Strings to Strings, and I have a variable someenum
that is an enumeration. I'd like to do something like ${somemap[someenum.toString()]}
. (Of course .toString() does not work, but what does?)