That can happen if your environment doesn't support EL 2.2. Invoking direct methods with parentheses/arguments like this
value="#{userbean.getAll()}"
is only supported since EL 2.2, which goes hand in hand with Servlet 3.0. If you're getting this exception, then that can only mean that you're not deploying to a Servlet 3.0 compatible container, or that your webapp's web.xml
is not declared conform Servlet 3.0, or that your webapp's /WEB-INF/lib
is littered with arbitrarily downloaded servletcontainer-specific JAR files originating from a completely different servletcontainer make/version which doesn't comply EL 2.2.
There are basically 2 solutions:
Use EL 2.1 compatible syntax, this works on Servlet 2.5 compatible containers:
value="#{userbean.all}"
Upgrade to a Servlet 3.0 compatible container (Tomcat 7, Glassfish 3, JBoss AS 6, etc), or fix your web.xml
to comply Servlet 3.0.
You should also make absolutely sure that your webapp's /WEB-INF/lib
does not contain any servletcontainer-specific libraries such as el-api.jar
and friends (see also this related question).
Please note that this is not a JSF problem at all. You got an exception from javax.el
/org.apache.el
package, not from javax.faces
/com.sun.faces
package. This means that it's an EL problem. It's basically saying that your EL syntax is wrong. It encountered an (
where it didn't expect that. The expected characters/operators are clearly listed thereafter.
See also:
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…