相关疑难解决方法(0)

添加<h:form>会导致java.lang.IllegalStateException:在提交响应后无法创建会话

添加后,我在一个非常简单的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)
Run Code Online (Sandbox Code Playgroud)

我在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>
Run Code Online (Sandbox Code Playgroud)

页面在浏览器上正确显示,但在控制台上我看到了异常.如果我删除了,Exception确实会消失<h:form>.

这是怎么造成的,我该如何解决?

forms session jsf jsf-2 illegalstateexception

47
推荐指数
2
解决办法
6万
查看次数

标签 统计

forms ×1

illegalstateexception ×1

jsf ×1

jsf-2 ×1

session ×1