添加后,我在一个非常简单的 JSF 2 页面中遇到以下异常<h:form>
:
java.lang.IllegalStateException: Cannot create a session after the response has been committed
at org.apache.catalina.connector.Request.doGetSession(Request.java:2758)
at org.apache.catalina.connector.Request.getSession(Request.java:2268)
我在 Tomcat 7.0.22 和 JDK 7 上使用 Mojarra 2.1.3 和 PrimeFaces3.0M4。
该页面是一个非常基础的数据表:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui">
<h:head>
</h:head>
<h:body>
<h:form>
<p:dataTable var="car" value="#{tableBean.cars}">
......
</p:dataTable>
</h:form>
</h:body>
</html>
该页面在浏览器上正确显示,但在控制台上我看到了异常。如果我删除<h:form>
.
这是如何引起的,我该如何解决?