Saturday, March 14, 2009

Do objects stored in a HTTP Session need to be serializable Or can it

Question :Do objects stored in a HTTP Session need to be serializable? Or can it
store any object? (Servlets)


Answer :Yes, the objects need to be serializable, but only if your servlet container
supports persistent sessions. Most lightweight servlet engines (like
Tomcat) do not support this. However, many EJB-enabled servlet engines
do. Even if your engine does support persistent sessions, it is usually
possible to disable this feature.

No comments: