Are you trying to literally see what is in each session? As in you don't
care that you can stuff the data in a global place because you are writing
some sort of admin app to inspect running sessions? If so I have bad news
for you.  Sessions are only guaranteed to be accessible for the length of
the request they are retrieved in. This is because they can be serialized to
the disk or passed to other servers or anything you like according to the
spec. Worse yet for you, good implementations use what is called a façade to
mask off the session and then re-use the same façade for multiple
session/requests. This means that keeping a reference to the session you
were given in some map or something wouldn't guarantee that what you put in
there would stay linked to the same session. What this all boils down to is
that they pretty thoroughly removed the ability to inspect running sessions
without being the app server or knowing about the internals of the app
server. There is a workaround, not a good one for all cases but...
  If you place an object in the session that holds all of your session data
(a hashmap?) then you can keep track of the object in some external
mechanism as well as having the session hold it for you. If you always go
through some intermediary to get and set values to mask of the fact that
they are going to this private store then it can automatically create it the
first time it is accessed to mask off the init for you. This has several
problems but should work fine on most of the app servers out there. (If you
are using a clustered app server you probably shouldn't do this)
  Is this the type of thing you are referring to?
  -Jeff Ward
 -----Original Message-----
From:   Wolfie [mailto:[EMAIL PROTECTED]] 
Sent:   Friday, February 23, 2001 1:51 PM
To:     [EMAIL PROTECTED]
Subject:        Re: a tag library that manages a session

That's a good idea, but unfortunately there's nothing in there that's useful
information on the level I need. And the HttpSessionContext, which has
methods to retrieve a session that's not your own has been deprecated.

Any other suggestions?

----- Original Message -----
From: "Shawn Bayern" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 23, 2001 3:24 PM
Subject: Re: a tag library that manages a session


> You're looking for the entire ServletContext, represented to JSP
> applications as "application scope."
>
> Shawn
>
> On Fri, 23 Feb 2001, Wolfie wrote:
>
> > Typically each browser window gets its own session. Is it possible to
share
> > a session between two devices of any sort, much less browsers?
> >
> >  ----- Original Message -----
> > From: "Ward, Jeff" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Friday, February 23, 2001 1:44 PM
> > Subject: RE: a tag library that manages a session
> >
> >
> > >   What do you mean by manage? You can access the session from inside
of a
> > > tag by using pageContext.getSession() and from there do whatever you
want
> > to
> > > it.
> > >   -Jeff Ward
> > >
> > >  -----Original Message-----
> > > From: Wolfie [mailto:[EMAIL PROTECTED]]
> > > Sent: Friday, February 23, 2001 10:43 AM
> > > To: [EMAIL PROTECTED]
> > > Subject: a tag library that manages a session
> > >
> > > I'm new to the tag library world, so this may be a simple one: I know
that
> > > that you can set the scope of a bean with the scope attribute of the
<jsp:
> > > useBean> tag, but can anyone explain how can I make my custom tag
library
> > > manage the entire session?
>

Reply via email to