【发布时间】:2013-07-11 16:56:16
【问题描述】:
我认为这很简单,但我被困住了。这个想法是想使用 liferay wizard,如:https://www.primefaces.org/showcase/ui/panel/wizard.xhtml。我在 xhtml 上有这个:
<h:form id="frmCreate">
<p:wizard flowListener="#{flowWizard.onFlowProcess}">
<p:tab id="header" title="Header">
<p:panel>
/*1*/
</p:panel>
</p:tab>
<p:tab id="detail" title="Detail">
<p:panel>
/*2*/
</p:panel>
</p:tab>
<p:tab id="confirmation" title="Confirmation">
<p:panel>
/*3*/
</p:panel>
</p:tab>
</p:wizard>
</h:form>
在豆子上:
@ManagedBean
@ViewScoped
public class FlowWizard {
public String onFlowProcess(FlowEvent event) {
return event.getNewStep();
}
}
但是当我尝试单击 NEXT 按钮时,它不会将页面更改为下一个选项卡,并且我在控制台上收到此错误消息:
11:16:21,663 ERROR [ExceptionHandlerAjaxImpl:62] java.io.NotSerializableException: com.wings.marketingevent.util.FlowWizard
javax.faces.FacesException: java.io.NotSerializableException: com.wings.marketingevent.util.FlowWizard
at com.sun.faces.renderkit.ResponseStateManagerImpl.getViewState(ResponseStateManagerImpl.java:137)
...
Caused by: java.io.NotSerializableException: com.wings.marketingevent.util.FlowWizard
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
...
Jul 13, 2013 11:16:21 AM org.apache.catalina.core.ApplicationDispatcher invoke
怎么了?谢谢。
【问题讨论】:
-
bean 的作用域是什么?
-
@Andy:我是
ViewScoped.. -
CDI 还是托管? JSF 版本是什么?抱歉,我无法复制您的错误。
-
@Andy:
Managed。 JSF 是 2.0.. -
抱歉,我无法复制错误。堆栈跟踪建议您需要在
FlowWizard处实现Serializable。也许你正在序列化它?所以试试吧。
标签: jsf primefaces liferay wizard notserializableexception