在页面导航URL中传递参数时出错

时间:2011-11-09 09:39:42

标签: seam

我使用seam-gen创建了一个接缝应用程序。保存并点击 Status.xhtml 表单中的完成按钮后,导航到 StatusList.xhtml 页面时出现以下错误。

错误是:

  

PWC2785:无法序列化会话属性org.jboss.seam.CONVERSATION#21 $ navigationBean for session 7800870138c191edf3d23718a68e

     

java.io.NotSerializableException:com.sitestuff.admin.NavigationBean

以下代码是为 Status.xhtml

中的完成按钮编写的
<s:button id="done" value="Done"action="#{statusHome.viewRecord}"/>

viewRecord方法是:

public String viewRecord() {
    getInstance();
    String rtValue = null;
    if (instance.getTextKey() != null) {
        rtValue = "/StatusList.xhtml?textKey=" + instance.getTextKey() +"?doSearch=1";
    } else {
        rtValue = "/StatusList.xhtml";
    }
    return rtValue;
}

我正在尝试将特定的textkey字段作为参数传递给字符串,因为我有一个过滤条件,并且只想在 StatusList.xhtml 表单上显示特定的textkey记录。

有谁能告诉我出了什么问题以及为什么会出现错误?

提前致谢。

此致

1 个答案:

答案 0 :(得分:0)

看起来你有Richfaces(我假设你正在使用它)配置为序列化会话状态,而“com.sitestuff.admin.NavigationBean”不是Serializable。

检查该bean /类是否实现了serializable。像

这样的东西
public class NavigationBean implements java.io.Serializable { ... }

我还假设你在使用NavigationBean的pages.xml上有一些规则,或者你有一些触发器在NavigationBean上触发了什么。

最近我在使用状态序列化时遇到了这个问题,希望它有所帮助。

相关问题