what you also can do is make your own wicket session object and implement:
HttpSessionBindingListener

then you will get public void valueUnbound(HttpSessionBindingEvent event); call
on your instance of your session. Then you can get the username of the wicket session.
and then deregister that when Application.get("name") or something like that.

johan



On 11/2/06, Alex Parvulescu < [EMAIL PROTECTED]> wrote:
Hello,
I decided to take Eelco's advice,and i added the Map.
It works fine now,my only concern is with the number of users increasing the size of this Map.But I think its a small price to pay
for this feature.

One thing though: I made a minor change to this idea: i actually added the session in the map during the login process,
storing only the username,not the entire Session.

Thanks guys!

Alex


On 11/1/06, Eelco Hillenius <[EMAIL PROTECTED] > wrote:
> 2. an extension of HttpSessionStore :
>
>     class MySessionStore extends HttpSessionStore {
>
>         @Override
>         protected void onUnbind(String sessionId) {
>             super.onUnbind(sessionId);
>             System.out.println("session: " + Session.get());
>             System.out.println("unbind sid " + sessionId);
>         }
>     }
>
> -no good ,i get an error - this is called after the session is detatched,or
> killed,or whatever

This can work, but you need to do some custom bookkeeping. For instance:

  private Map<String, Session> sessions = new ConcurrentHashMap<String, Session>

  protected void onBind(Request request, Session newSession) {
    sessions.put(newSession.getId(), newSession);
  }

  protected void onUnbind(String sessionId) {
    Session session = sessions.remove (sessionId);
    ...
  }

or any alternative implementation that works for you. It is a bit
inconvenient that Session.get is not available anymore in the unbind
method. But I can't think of something that works better at this
moment, due to how session binding listeners work (they are called in
the middle of the destruction process).

Eelco

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to