> with the same jsps. The hashmap seems to be the way to go,
> unless someone
> can think of something more elegant.
we've used a similar approach with success...
One of our customers wanted us to allow them to see active sessions...
luckily we make very little use of the HttpSession in our applications
anyway -- we always place our session data in a single SessionInfo object
that is stored in the HttpSession (advantages of this approach include lazy
initialization, type checking, etc.)
Typically we have a private constructor on the SessionInfo object, and then
a static method that returns the SessionInfo for an HttpSession. If one is
already there, it returns it (this gives a nice central place to store the
key...) If one is not there it initializes one and places it in the
session, then returns it.
Anyway this SessionInfo object adheres to the HttpSessionBindingListener
interface, and notifies the external "monitor" when it is bound and unbound.
This approach has been very effective for us.
For you to do what you're looking for, you'd have the static method keep its
own table of values so that when one isn't already in the http session, it
could see if the PDA or desktop had already created the one it should be
paired with. You end up doing a little of your own session management
though...
Good luck!
Tim
> -----Original Message-----
> From: Wolfie [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 23, 2001 7:18 PM
> To: [EMAIL PROTECTED]
> Subject: Re: a tag library that manages a session
>
>
> Yes. I'm trying to find a way to get one session to recognize
> activity from
> 2 different devices, i.e. a pda and a desktop, accessing and
> interacting
> with the same jsps. The hashmap seems to be the way to go,
> unless someone
> can think of something more elegant.
>
> ----- Original Message -----
> From: "Ward, Jeff" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, February 23, 2001 7:41 PM
> Subject: RE: a tag library that manages a session
>
>
> 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?
> >
>