java - Spring Webflow 和继承
问题描述
我在 Spring WebFlow 中遇到了一个问题。我有一个扩展类 B 的类 A。类 B 看起来像这样:
public class B{
private Collection<Class<?>> hints = new ArrayList<>();
public B(){}
public B(Collection<Class<?>> hints){ this.hints=hints; }
//getter and setter for hints
}
A 类是一个表单,有一些字符串/整数作为私有字段。A 类扩展了 B 类并实现了 Serializable。在执行 WebFlow 期间,它some sort of the map
可能以可能的形式存储对象并重新生成 A 的实例。遗憾的是,它不会复制 B 类。在hints
B 类的每次重新生成之后都是空集合。你能解释一下为什么会这样吗?我应该怎么做才能让它发挥作用?
解决方案
好的,我想我很快就把它贴出来了。在 B 类中实现Serializable
就可以了。但为什么?Spring WebFlow
实施有何不同Serializable
?
推荐阅读
- ansible - 使用 ansible playbook 按所有者搜索
- javascript - 对于像 (25) 这样带有角度百分比管道的数字,限制为 2 位小数
- r - 使用 tidync 只读取变量的子集
- oracle - 如何找到最近的定位点?
- fmt - 在 Windows 32 上使用 Intel C 编译 fmt
- google-apps-script - 如何在 Google Apps 脚本中停止 foreach 循环
- navigation - Orocommerce Akeneo 在导航栏中显示类别
- python - 熊猫如何检查一列的子字符串是否是另一列的子字符串
- r - 在并行处理中,选择所有包含 r 中特定关键字的行
- c - C语言文件I/O中的二进制模式和文本模式