> 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