Is it possible to use an EL expression inside web.xml?
Not certainly in that way. By default, the servletcontainer server does not check EL context parameters when parsing web.xml during application startup. However, tools such as Ant and Maven, and some servlet containers such as JBoss (after setting a specific configuration parameter) can be created using ${...} syntax similar to EL for built-in environment variables and / or VM arguments based on them name in multiple deployment descriptor XML files such as web.xml , ejb-jar.xml and persistence.xml . Note: these are not the variables that you declared in the JSF EL scope, such as a managed bean.
Will this work?
It will work only if PrimeFaces gets the static value "#{userUtilityBacking.direction}" as a String , and then programmatically EL evaluates it in the current EL context, using, for example, Application#evaluateExpressionGet() . But, based on the source code of PrimeFaces 3.5, it does nothing. Looks like they only implemented it for 4.x.
In your particular case, you just need to specify the direction directly on the <html> element to apply it to the general document and / or in the dir attribute of an arbitrary HTML or JSF component.
<html dir="#{userUtilityBacking.direction}">
source share