1

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?

Community
  • 1
  • 1
Danilo Piazzalunga
  • 7,590
  • 5
  • 49
  • 75

1 Answers1

1

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:

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • I would never have thought that the file name was wrong. Anyway: `.jsp` was wrong even with Facelets 1.x, wasn't it? – Danilo Piazzalunga Jan 30 '14 at 08:06
  • 1
    Indeed. The `.jsp` is a special file extension which is recognized by the server's JSP/Servlet container and processed as such before passing the request further to JSF. – BalusC Jan 30 '14 at 08:08