title: Adding <h:form> causes java.lang.IllegalStateException: Cannot create a session after the response has been committed
body: <p>I'm facing the following exception in a very simple JSF 2 page after adding <code>&lt;h:form&gt;</code>:</p>
  
  <pre><code>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)
  </code></pre>
  
  <p>I'm using Mojarra 2.1.3 and PrimeFaces3.0M4, on Tomcat 7.0.22 and JDK 7.</p>
  
  <p>The page is a very basic data table:</p>
  
  <pre><code>&lt;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"&gt;
  &lt;h:head&gt;
  
  &lt;/h:head&gt;
  &lt;h:body&gt;
      &lt;h:form&gt;        
          &lt;p:dataTable var="car" value="#{tableBean.cars}"&gt;
  
                   ......
          &lt;/p:dataTable&gt;
      &lt;/h:form&gt;
  &lt;/h:body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The page shows correctly on the browser, but on the console I see the exception. The Exception does disappear if I remove the <code>&lt;h:form&gt;</code>.</p>
  
  <p>How is this caused and how can I solve it?</p>