(sorry if this has gone to far off on a tangent everyone)

  Before you go down the hashmap path you may want to step back and think of
what you are really designing. It appears to me that what you really want is
a way to interact with the same processes and not the same session(view). If
you have a process object, MyProcess, that maintains state and is accessible
in a common way then you solve your problem without abusing the view. EJBs
can do this for you or, if you don't want the overhead (code and speed), use
a factory method rooted in the classpath somehow. To get the process you
want you could call something like:
   MyProcess currentProcess = MyProcess.getProcess(user);
The factory method guarantees that if there is a process already started for
that user it will give you that one but if not then it will create a new
one. For each process you want to share have a different process.
  The benefit of this is you have a clean object representing the shared
data/actions and if you start using something that doesn't have access to
the session this will still work.
  Hope this helps.
  -Jeff Ward
 -----Original Message-----
From:   Wolfie [mailto:[EMAIL PROTECTED]] 
Sent:   Friday, February 23, 2001 5: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?
>

Reply via email to