On page 258 of Head First Book abt Http session migration & Serialization , it says: "A Container is required to migrate Serializable attributes...... .....But a Container is not required to use Serialization as the means of migrating the session....".
I am confused here. Does that mean:
1) If you want the instance variables of a attribute to be saved & restored, you wld EITHER hv to make the attribute class Serializable OR implement the mtds of HttpSessionActivationListener class if your attribute class is not Serializable? Another qn, but the attribute wld guaranteed be migrated anyways(just that the values of its instance variables may not)?
2) Also, we cld use readObject() & writeObject() mtds of a serializable attribute class to save & restore its non-serializable/transient instance variables. And since the Container MAY not run readObject() & writeObject() mtds during session migration, we ought to implement the mtds of HttpSessionActivationListener class to save such instance variables then?