This is more related to EL than to JSF/Spring/OmniFaces. The Apache EL implementation as used by Tomcat is indeed quite restrictive as to reserved keywords. So is for example #{bean.class.name}
(as in, print bean.getClass().getName()
) possible in Oracle EL implementation as used by GlassFish, but not in Apache EL implementation as used by Tomcat. You should instead be writing it as #{bean['class'].name}
. All other Java keywords listed in chapter 3.9 of Java Language specification which are not listed in chapter 1.17 of EL specification are also blocked by the Apache EL implementation. The const
is indeed among them.
On a side note, it's recommended to start the constants var
with an uppercase. This convention allows better distinguishing between managed bean instances and constant references in the EL scope. It also instantly solves your problem as Const
is not the same as const
.
<o:importConstants var="Const" type="util.IntegerConstants" />
DATA_TABLE_PAGE_LINKS : #{Const.DATA_TABLE_PAGE_LINKS.value}
Or just rename the enum, the var
defaults namely to Class#getSimpleName()
.
<o:importConstants type="util.Const" />
DATA_TABLE_PAGE_LINKS : #{Const.DATA_TABLE_PAGE_LINKS.value}