Je suis confronté à l'exception suivante dans une page JSF 2 très simple après avoir ajouté <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)
J'utilise Mojarra 2.1.3 et PrimeFaces3.0M4, sur Tomcat 7.0.22 et JDK 7.
La page est un tableau de données très basique :
<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>
La page s'affiche correctement dans le navigateur, mais dans la console, je vois l'exception. L'exception disparaît si je supprime le <h:form>
.
Comment cela se produit-il et comment puis-je le résoudre ?