【问题标题】:Getting error while passing a parameter in page navigation url在页面导航 url 中传递参数时出错
【发布时间】:2011-11-09 09:39:41
【问题描述】:

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

错误是:

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

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

以下代码是为 Status.xhtml

中的 Done 按钮编写的
<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 记录。

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

提前致谢。

问候,

【问题讨论】:

    标签: seam


    【解决方案1】:

    您似乎已将 Richfaces(我假设您正在使用它)配置为序列化会话状态,并且“com.sitestuff.admin.NavigationBean”不可序列化。

    检查该 bean/类是否实现了可序列化。类似的东西

    public class NavigationBean implements java.io.Serializable { ... }
    

    我还假设您在 pages.xml 上有一些使用 NavigationBean 的规则,或者您有一些在 NavigationBean 上触发某些东西的拦截器。

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-02-06
      • 1970-01-01
      • 2012-05-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多