Look closer at the stack trace. Here’s the relevant part:
...
org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:189)
com.sun.faces.facelets.el.ELText$ELTextVariable.toString(ELText.java:217)
com.sun.faces.facelets.el.ELText$ELTextComposite.toString(ELText.java:157)
com.sun.faces.facelets.compiler.CommentInstruction.write(CommentInstruction.java:77)
...
It’s thus evaluating EL in a comment block (recognizable by CommentInstruction
). A comment block is considered as template text. Facelets evaluates by default also EL #{}
in template text. It’s like as if you’re writing <p>#{screenShotBean.takeScreenshot}</p>
without any JSF tag.
You’ve several options:
-
Remove the comment block altogether.
-
Escape EL expressions in the comment by prefixing it with
\
as in\#{screenShotBean.takeScreenshot}
so that they won’t be evaluated.
-
Wrap the entire comment block in
<ui:remove>
so that it doesn’t appear in the component tree (nor in the generated HTML output). -
Disable parsing of all comments by Facelets by adding the following context parameter to
web.xml
:<context-param> <param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name> <param-value>true</param-value> </context-param>
Note that no one comment will end up in generated HTML output this way.