0

我目前在使用 Spring Web Flows 2.0.7 时遇到问题,当提交变量时,webflow 崩溃。对应的 webflow 如下所示:

<flow xmlns="http://www.springframework.org/schema/webflow"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.springframework.org/schema/webflow
                          http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd">

  <!-- some model, i use below -->
  <var name="register"
       class="org.zcore.conference.Registration" />

  <!-- my input id -->
  <input type="long" name="conId" value="flowScope.conId"/>

  <!-- my first view state -->
  <view-state id="register" model="register">
  <!-- imagine much more stuff here -->
</flow>

当输入带有附加 conId (http://localhost:8080/app/myflow?conId=123) 的流时,会弹出以下错误:

2012-08-07 17:33:34,583 WARN 25205715@qtp-28882952-5 com.coremedia.cae.webflow.AbstractFlowViewController - Error handling flow request: 'Could not serialize flow execution; make sure all objects stored in flow or flash scope are serializable': /app/flow
org.springframework.webflow.execution.repository.snapshot.SnapshotCreationException: Could not serialize flow execution; make sure all objects stored in flow or flash scope are serializable

我很惊讶,提供的值似乎不是可序列化的,因为它是一个简单的 int 值。看起来我在这里缺少一些基本的东西。

4

1 回答 1

1

确保 org.zcore.conference.Registration 是可序列化的,如果是,那么它可能是您视图状态中的另一个对象,不是

于 2012-08-08T13:41:12.460 回答