3

We have a RequestScoped managed bean working fine. We want to convert it to ViewScoped so that we can reduce initializing the bean every time we call listener method. But when we changed the scope we got NotSerializable error, because we have objects being invoked by Bean were not implemented Serializable. We came to know that the problem was because of storing the object in the disk, fair enought thats fine. But when we change the scope to SessionScoped, it worked fine, without being converting all the beans implements Serializable.

My question is, why do we need to implements Serializable only for ViewScoped and not for SessionScoped, as both needs to be stored in the disk.

Vasil Lukach
  • 3,658
  • 3
  • 31
  • 40
nani21984
  • 911
  • 2
  • 13
  • 21

0 Answers0