> From: sanchit.sriv [mailto:sanchit.srivast...@morganstanley.com] > Subject: Retrieving all active sessions > > > I need to write a Servlet or some kind of java program (which > may be deployed as part of a webapp on the same container) that > can get me the count of all active sessions on that tomcat > Also if possible, active sessions per context path
Rather than mucking around with the internals of Tomcat, implement an HttpSessionListener for each webapp of interest; see the servlet spec for details about event listeners. You could also write a Tomcat-specific valve at the <Engine>, <Host>, or <Context> level, but that ties you to a specific version of Tomcat. The session information is also available via JMX. If you want a webapp that already does it, look at Lambda Probe: http://lambdaprobe.org - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org