This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Struts and the fly likes ActionForm subclasses have to implement Serializable? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "ActionForm subclasses have to implement Serializable?" Watch "ActionForm subclasses have to implement Serializable?" New topic
Author

ActionForm subclasses have to implement Serializable?

Bob Watson
Greenhorn

Joined: Dec 04, 2003
Posts: 4
Hello everyone,
In Jakarta struts API ActionForm, there is a sentence -- "Because ActionForms are JavaBeans, subclasses should also implement Serializable, as required by the JavaBean specification."
If I create my own super Form like this:
public abstract class MyGeneralActionForm extends ActionForm { ... }
it will still work. My question is -- do we have to implement Serializable?
Thanks a lot!
Rick Hightower
Author
Ranch Hand

Joined: Feb 20, 2002
Posts: 350
ActionForm API docs
Get the API docs. Get the source. Documents sometimes lie. Source code and API docs do not.

In short, no you don't have to implement java.io.Serializable because it is done by the super class.


Rick Hightower is CTO of Mammatus which focuses on Cloud Computing, EC2, etc. Rick is invovled in Java CDI and Java EE as well. linkedin,twitter,blog
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: ActionForm subclasses have to implement Serializable?