Resolvers assume that all JSPs produce a FacesContext
------------------------------------------------------
Key: MYFACES-1536
URL: https://issues.apache.org/jira/browse/MYFACES-1536
Project: MyFaces Core
Issue Type: Bug
Components: JSR-252
Affects Versions: 1.2.0-SNAPSHOT
Reporter: Paul McMahan
Priority: Critical
It seems that when MyFaces has been enabled it assumes that all the JSPs in a
web app will produce a FacesContext. But that's not the case for JSPs like the
following:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
java.util.ArrayList mylist = new java.util.ArrayList();
mylist.add("one");
mylist.add("two");
mylist.add("three");
pageContext.setAttribute("mylist", mylist);
%>
<c:forEach var="x" items="${mylist}">
<p>${x}</p>
</c:forEach>
And the error is:
java.lang.NullPointerException
org.apache.myfaces.el.unified.resolver.ManagedBeanResolver.externalContext(ManagedBeanResolver.java:217)
org.apache.myfaces.el.unified.resolver.ManagedBeanResolver.getValue(ManagedBeanResolver.java:146)
javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:45)
org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:101)
org.apache.jsp.index_jsp._jspx_meth_c_005fforEach_005f0(index_jsp.java:95)
org.apache.jsp.index_jsp._jspService(index_jsp.java:68)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
This looks like there's a problem in the resolvers where the ELContext is
expected to always have a FacesContext.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.