aspose file tools*
The moose likes Servlets and the fly likes Why is HttpServlet Serializable? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Why is HttpServlet Serializable?" Watch "Why is HttpServlet Serializable?" New topic
Author

Why is HttpServlet Serializable?

Joseph Sweet
Ranch Hand

Joined: Jan 29, 2005
Posts: 327
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.


We must know, we will know. -- David Hilbert
Joan Horta Tosas
Ranch Hand

Joined: Feb 01, 2007
Posts: 59
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

Joined: Mar 06, 2001
Posts: 13459

And clustering
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why is HttpServlet Serializable?