Forums Register Login

Session Logging

+Pie Number of slices to send: Send
I have an application deployed on WebSphere Application Server 4.0( supports Servlet 2.2). I want to log following events:
1. Session is created.
2. Session is destroyed
Please let me know how can I do this. Please reply soon.
Thanking in advance.
Neha
+Pie Number of slices to send: Send
As I recall, the HttpSessionBindingListener interface was supported in the 2.2 API (more listener interfaces were added with 2.3). You could add an object implementing this interface to every new session. It will get notified on the initial adding and when the session is destroyed.
Bill
+Pie Number of slices to send: Send
Thanks a lot for the reply.
Could you please let me know what will be its behavior in a distributed environment?
Regards
Neha
+Pie Number of slices to send: Send
Please let me know what will happen when the session is migrated to another JVM.
Thanks
+Pie Number of slices to send: Send
 

Originally posted by Neha Srivastava:
Please let me know what will happen when the session is migrated to another JVM.
Thanks


An object that implements the HttpSessionListener interface is notified when a session is created or destroyed in its web app context
interfaces (or classes): javax.servlet.http.HttpSessionListener
methods:
void sessionCreated(HttpSessionEvent e)
void sessionDestroyed(HttpSessionEvent e)
- called when session is destroyed (invalidated)

<B>behavior in a distributable: sessions may migrate from one jvm or machine to another; hence the session destroy event may occur on a different jvm/machine than the session create event. </B>
Thanks,
Moorthi
I claim this furniture in the name of The Ottoman Empire! You can keep this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1413 times.
Similar Threads
failed to lazily initialize a collection - no session or session was closed
Servlet Sessions Coding
request redirection and session
SLSB as Session Façade
how to set the request Session in Strut2
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 08:33:13.