You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by teh j <to...@yahoo.com.au> on 2001/04/03 02:13:15 UTC

hashtables in session

Hi guys

just wondering if it was possible to store Hashtable 
objects in the implicit session object?

thanks
Jason

_____________________________________________________________________________
http://my.yahoo.com.au - My Yahoo!
- Have news, stocks, weather, sports and more in one place.

Re: hashtables in session

Posted by Joe Laffey <jo...@laffeycomputer.com>.
On Tue, 3 Apr 2001, Bo Xu wrote:

> teh j wrote:
>
> > Hi guys
> >
> > just wondering if it was possible to store Hashtable
> > objects in the implicit session object?
> >
> > thanks
> > Jason
> > [...]
>
> Hi :-) I remember I have seen several emails in Servlet-List about it,
> it is possible, and I remember perhaps it is better to make all the key-value
> object Serializable, and perhaps it is better to notice which classloader loads
> those object.

That's right: You can store ANY object in the session object if you need
to. These object are required to be serializable (implement
java.io.Serializable), though most servlet engines will let you slide
without this. However, it is a very bad idea to have any session object,
especially a large one, not serializable.


Joe Laffey
LAFFEY Computer Imaging
St. Louis, MO
----------------------
Need to do multi-file string replacement in Un*x, but don't want to mess
with sed? Try rpl. It's a free text replacement utility with source.
http://www.laffeycomputer.com/rpl.html  -- Check it out!
------------------------------------------------------------------------


Re: hashtables in session

Posted by Bo Xu <bo...@cybershop.ca>.
teh j wrote:

> Hi guys
>
> just wondering if it was possible to store Hashtable
> objects in the implicit session object?
>
> thanks
> Jason
> [...]

Hi :-) I remember I have seen several emails in Servlet-List about it,
it is possible, and I remember perhaps it is better to make all the key-value
object Serializable, and perhaps it is better to notice which classloader loads
those object.

Bo
Apr.03, 2001