o:importConstants not applied to method arguments in EL #98

RayDeCampo opened this Issue Feb 12, 2015 · 2 comments


None yet

2 participants


I tried using importConstants on an Enum and then passing the imported value to a method like so:

<o:importConstants type="my.enum.class.Role" />
This worked: #{Role.operator}
This passed null to the method: #{cc.attrs.user.roles.contains(Role.operator)}

I was inside a composite component (not sure if relevant). Passed in a User object with a roles attribute which is Set.

I am using OmniFaces 2.0 and WildFly 8.2.0.Final with the stock JSF/EL libraries (Mojarra 2.2.8 and what looks like the GlassFish EL implementation version 3.0.1-b05).

BalusC commented Mar 2, 2015

It's put in Facelet scope, which is kind of weird/buggy in composite components in Mojarra. It should work when declared in the template client containing the composite. This all works fine in MyFaces.

One way to bypass it would be putting it in the request scope instead of Facelet scope. @arjantijms What do you think about this one?

@BalusC BalusC closed this in ceb50e7 Mar 17, 2015
BalusC commented Mar 17, 2015

Fix is available in today's latest 2.1 snapshot.

@VsevolodGolovanov VsevolodGolovanov pushed a commit to VsevolodGolovanov/omnifaces that referenced this issue May 18, 2016
s.golovanov Revert "Fix #98 let importConstants put in request scope instead of f…

This reverts commit ceb50e7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment