JSF error on Glassfish: PWC6228: #{…} not allowed in a template text body

If you forget to include the JSF taglibs in a JSP that’s part of a JSF app, you’ll get this rather obscure error on Glashfish 3.1.1:

WARNING: StandardWrapperValve[faces]: PWC1406: Servlet.service() for
servlet faces threw exception org.apache.jasper.JasperException:
/configure.jsp(13,34) PWC6228: #{...} not allowed in a template
text body.

 

Add the taglibs to fix:

<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>

Edit:
I’ve subsequently realized in following some JSF tutorials that apparently there’s substantial difference between JSF 1.2 and 2.0, and that the errors I was running into were because I wrongly assumed JSF2.0 used JSP pages (it used XHTML Facelets instead), and so most of the issues I was running into were as a result of trying to do things the wrong way for 2.0.

One Reply to “JSF error on Glassfish: PWC6228: #{…} not allowed in a template text body”

  1. The Glassfish 3.1.1 verifier emits lots errors like this with our application (which was fine under 2.1.1), has the namespace changed?
    PWC6188: The absolute uri: http://java.sun.com/jsf/core cannot be resolved in either web.xml or the jar files deployed with this application

Leave a Reply to Ed Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.