Hi,
I am currently struggling with HTTP Whiteboard Session Listener. I have 2
servlets that use their own ServletContextHelpers and ServletFilters which are
registered for both the aforementioned Servlet Contexts. The filters and
servlets are working as expected but the custom HttpSessionListener callbacks
are never getting triggered when HttpRequest#getSession() is invoked in one of
the servlets.
As an example,
@Component
@HttpWhiteboardListener
public final class ApplicationSession implements HttpSessionListener {
private final AtomicInteger activeSessions = new AtomicInteger();
@Override
public void sessionCreated(final HttpSessionEvent sessionEvent) {
activeSessions.incrementAndGet();
}
@Override
public void sessionDestroyed(final HttpSessionEvent sessionEvent) {
activeSessions.decrementAndGet();
}
public boolean isSessionValid() {
return activeSessions.get() != 0;
}
}
This is the custom listener I registered with the HTTP Whiteboard and it never
gets invoked when I call HttpRequest#getSession().
Is there anything I am missing? I would really appreciate further help on this
regard. For your information, I am currently using the latest version of Felix
Jetty Bundle (4.0.6).
Thanks and Regards,
Amit Kumar Mondal
Phone: +49 160 9100 3436 Email: [email protected]
Skype: arsenalnerk GitHub: amitjoy
Blog: blog.amitinside.com