gpt4 book ai didi

jsf-2 - java.io.NotSerializableException - org.omnifaces.taghandler.Converter

转载 作者:行者123 更新时间:2023-12-04 04:42:18 26 4
gpt4 key购买 nike

我有一个在 Jboss 6 上使用 Primefaces 3.5 和 Omnifaces 1.5 的应用程序,使用 myfaces 2.1.5

关于尝试使用 o:converter我收到以下错误。

org.omnifaces.taghandler.Converter

viewId=/xhtml/propelModules/initiatePropel.xhtml
location=C:\jboss-6.1.0.Final\server\default\deploy\PropelEAR.ear\PropelWeb.war\xhtml\propelModules\initiatePropel.xhtml
phaseId=RENDER_RESPONSE(6)

Caused by:
java.io.NotSerializableException - org.omnifaces.taghandler.Converter
at java.io.ObjectOutputStream.writeObject0(Unknown Source)

有关的代码是...
<p:selectManyCheckbox value="#{initiatePropelManagedBean.currentWon.selectedEmployeeList}" 
layout="pageDirection">
<o:converter converterId="omnifaces.ListIndexConverter"
list="#{initiatePropelManagedBean.currentWon.employeeList}" />
<f:selectItems value="#{initiatePropelManagedBean.currentWon.employeeList}"
var="emp" itemLabel="#{emp}" itemValue="#{emp}" />
<p:ajax process="@this" update="employeeCount"></p:ajax>
</p:selectManyCheckbox>

最佳答案

我可以重现你的问题。这是 MyFaces 2.1.5 中的一个错误。我找不到相关的错误报告和修复版本,但我至少可以说这个结构对我来说对当前最新的 MyFaces 2.1.12 来说很好用。因此,升级 MyFaces 也应该对您有用。

无关 对于具体问题,这里的转换策略有些奇怪。只需使用 omnifaces.SelectItemsConverteromnifaces.SelectItemsIndexConverter (如果您在 equals() 实体上没有好的 Employee)应该就足够了。

<p:selectManyCheckbox ... converter="omnifaces.SelectItemsIndexConverter">
<f:selectItems value="#{initiatePropelManagedBean.currentWon.employeeList}" />
</p:selectManyCheckbox>
SelectItems(Index)Converter不严格要求 List<SelectItem>作为模型,它只需要一个 <f:selectItem(s)>在 View 中。 List(Index)Converter适用于不使用 <f:selectItem(s)> 的组件,例如 <p:autoComplete> , <p:picklist>

如果由于某种原因无法升级 MyFaces,这将是替代解决方案。

关于jsf-2 - java.io.NotSerializableException - org.omnifaces.taghandler.Converter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18713264/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com