我正在使用 JSF 2.1、Richfaces 4.2.2,对于下面提到的代码,我得到了 java.io.NotSerializableException: org.richfaces.component.SavedState 异常。
Bean范围:会话
面码代码:
<rich:dataTable id="table" value="#{mapActivityGroup.addActivityGroupModelList}"
var="model">
<rich:column>
<h:selectBooleanCheckbox id="checkBox" value="#{model.selected}" />
</rich:column>
<rich:column filterValue="#{mapActivityGroup.categoryFilter}"
filterExpression="#{fn:containsIgnoreCase(model.categoryName,
mapActivityGroup.categoryFilter)}" >
<f:facet name="header">
<h:panelGroup>
<h:outputText value="Category" />
<h:inputText value="#{mapActivityGroup.categoryFilter}">
<a4j:ajax render="table" execute="@this" event="blur" />
</h:inputText>
</h:panelGroup>
</f:facet>
<h:outputText value="#{model.categoryName==null?'':model.categoryName}"/>
</rich:column>
</rich:dataTable>
例外:
java.io.NotSerializableException: org.richfaces.component.SavedState
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1180)
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346)
java.util.HashMap.writeObject(HashMap.java:1100)
sun.reflect.GeneratedMethodAccessor1947.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:601)
java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:975)
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1480)
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1362)
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1170)
java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1362)
我用谷歌搜索但找不到任何实质性的东西。有谁知道为什么会这样?