Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubts on Http session migration & Serialization

 
XiuQing Lin
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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?


Thanks a lot for reading. Have a nice day ahead.
 
Gowher Naik
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i found this in FREDERIC pdf
 
Tridib Samanta
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where can I find this FREDERIC pdf?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic