Passing a enum value as a tag attribute in JSP
Posted
by
Jakub
on Stack Overflow
See other posts from Stack Overflow
or by Jakub
Published on 2011-11-22T08:01:23Z
Indexed on
2011/11/22
9:51 UTC
Read the original article
Hit count: 214
I have a custom JSP tag which is using a parameter which is an enum. This approach is a consequence of using other classes which need this enumeration. The point is I have no clue how to assign an enum value in the EL:
<mytaglib:mytag enumParam="${now what do I type here?}" />
The only workaround which I found so far was to make the enumParam an Integer and convert it to desired values:
<mytaglib:mytag enumParam="3" />
I believe there must be a better way to do it. Please help.
© Stack Overflow or respective owner