Action 类需要序列化吗?它何时以及如何发生,如果有的话。
最佳答案
据我所知,它不需要是可序列化的,让 ActionSupport 实现该接口(interface)是错误的。
这是我在该主题上找到的最佳推理(取自 here):
It's very common in web frameworks to use Serializable objects for a couple or reasons, such as being able to preserve state across a server restart and for shipping objects around in a cluster.
With that said, (IMHO) I believe it was a design mistake to have ActionSupport implement Serializable. I don't believe that either of the above really apply to Action objects since they are short-lived. The choice of making Actions Serializable should have been left to the developer and not "forced" by the framework.
关于serialization - 为什么 ActionSupport 实现 Serializable,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4790636/