• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why is HttpServlet Serializable?

 
Joseph Sweet
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

Why is HttpServlet (or GenericServlet) Serializable?

Same for HttpSessionBindingEvent, HttpSessionEvent, ServletContextEvent, ServletContextAttributeEvent.

They seem to live forever in the container, never travel outside of it. I have not noticed they have to be persisted either. So why is the need for serialization?

I appreciate your opinions.
 
Joan Horta Tosas
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure, but I think it's to allow the container to persist their state and "suspend/resume" them according to their use, pooling, etc... I can't think of another reason.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And clustering
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic