Question

I am trying to an application from JSF 1.2 to JSF 2.0. Basically, I am following those guides:

After getting a great deal of the expected errors, I got this unexpected error message (names changed to protect the guilty):

weblogic.servlet.jsp.CompilationException: Failed to compile JSP /mypage.jsp
mypage.jsp:10:36: The deferred EL expression is not allowed since deferredSyntaxAllowedAsLiteral is false.
            <ui:param name="pageTitle" value="#{myBundle.myPageTitle}" />
                                              ^---------------------^

Does this error mean I have fallen back to JSP presentation technology?

Was it helpful?

Solution

You're writing Facelets specific tags <ui:xxx> inside a JSP file instead of a Facelets (XHTML) file.

This is indeed not going to work. That piece of code is basically interpreted as plain text, it's as if you're writing down plain HTML/XML. You would have gotten exactly the same error if you were using e.g.

<p>#{myBundle.myPageTitle}</p>

In other words, the EL expression is been interpreted as part of "template text" and the deferred EL form #{} is in JSP not supported in template text, only the immediate EL form ${} is supported in template text.

The solution is rather simple: rename mypage.jsp to mypage.xhtml and don't forget to replace all other JSP-specific tags like <%@...%> and <jsp:xxx> by Facelets/XHTML ones.

See also:

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top