(Answering here also because the response on TOMCAT-DEV didn't come to
this list)

On Tue, 15 Jan 2002, Oto Buchta wrote:

> Date: Tue, 15 Jan 2002 13:39:04 +0100
> From: Oto Buchta <[EMAIL PROTECTED]>
> Reply-To: Tomcat Developers List <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: How to receive Session Manager from servlet?
>
> Hi,
> I'm revriting the application from the JSDK2.0 to current Tomcat and I found
> a very big problem - HttpSessionContext.getIds() is deprecated. It's clear
> why, but it brings a critical problem for me.
>
> I've found (in tomcat javadoc), that the
> org.apache.catalina.Session.getManager().findSessions() should help me, but I
> cannot find the way how to use the getManager() method, because
> request.getSession() returns StandardSessionFacade instead of the
> StandardSession, which implements the interface org.apache.catalina.Session.
>
> And my question is this: Could I receive the manager in another way than
> rewritting the facade by changing private session to public?
>
> Thanks very much,
> --
> Oto 'tapik' Buchta
>

In a servlet 2.3 environment (Tomcat 4), you can accomplish your goal
without getting into the innards of the container.  Simple create and
register an HttpSessionListener, which will be notified every time a
session within your app is created or destroyed -- it's easy to maintain a
local HashMap (or something) of the currently active sessions.

Craig


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to