This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Servlets and the fly likes Need for servlet serialization Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Need for servlet serialization" Watch "Need for servlet serialization" New topic

Need for servlet serialization

Java Green

Joined: Sep 07, 2004
Posts: 7
Why the servlets need to implement Serializable interface.
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

"Java Green"-
Welcome to the JavaRanch! Please adjust your displayed name to meet the

JavaRanch Naming Policy.

You can change it


Thanks! and welcome to the JavaRanch!


Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
Julian Kennedy
Ranch Hand

Joined: Aug 02, 2004
Posts: 823
I think this is a fairly FAQ. I would guess that the answer is that if Servlet didn't implement Serializable then it wouldn't be able to be serialized. It only needs to implement Serializable if it needs to be serialized. The question then becomes why would you need to serialize a Servlet. I don't know the answer to that and, perhaps, neither did the original developers. Maybe the decision was taken to implement Serializable in case some valid reason for serializing a Servlet materialized. After all, there are no obvious adverse effects of this implementation.

Peter den Haan
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
See this thread for the answer.

- Peter
I agree. Here's the link:
subject: Need for servlet serialization
It's not a secret anymore!