PrimeFaces:java.io.IOException:GZIP形式ではありません

最近、PrimeFacesの `idleMonitor`コンポーネントをテストしています。

<!DOCTYPE html>
<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:ui="http://java.sun.com/jsf/facelets"
    xmlns:p="http://primefaces.org/ui">

<h:head>
</h:head>
<h:body>
  <h1>PrimeFaces and idleMonitor</h1>

    <p:growl id="messages" showDetail="true" sticky="true"/>

    <p:idleMonitor timeout="10000" update="messages">
    <p:ajax event="idle" listener="#{idleBean.idleListener}" update="messages"/>
    </p:idleMonitor>

</h:body>
</html>

問題

10秒後、コンソールは `java.io.IOException:GZIP形式ではない`とプロンプトを出す?それは不思議です、GZIPは `idleMonitor`コンポーネントと何をするのですか?

INFO: Server startup in 4279 ms
Aug 8, 2012 2:42:48 PM com.sun.faces.renderkit.ClientSideStateHelper doGetState
SEVERE: Not in GZIP format
java.io.IOException: Not in GZIP format
    at java.util.zip.GZIPInputStream.readHeader(GZIPInputStream.java:141)
    at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:56)
    at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:65)

解決策

これを修正するには、すべてのPrimeFacesコンポーネントを `form`タグで囲みます。理由は分かりませんが、問題を解決しました。

<!DOCTYPE html>
<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:ui="http://java.sun.com/jsf/facelets"
    xmlns:p="http://primefaces.org/ui">

<h:head>
</h:head>
<h:body>
<h1>PrimeFaces and idleMonitor</h1>

  <h:form>

    <p:growl id="messages" showDetail="true" sticky="true"/>

    <p:idleMonitor timeout="10000" update="messages">
    <p:ajax event="idle" listener="#{idleBean.idleListener}" update="messages"/>
    </p:idleMonitor>

  </h:form>

</h:body>
</html>