aspose file tools*
The moose likes Tomcat and the fly likes How to get Session count from container Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "How to get Session count from container" Watch "How to get Session count from container" New topic
Author

How to get Session count from container

Mamatha K S
Greenhorn

Joined: Jul 17, 2006
Posts: 2
Hi,
I am doing some admin part of my web application.
So I want to get no of sessions, execution time etc for all sessions in a tomcat container.
"org.apache.catalina.session.ManagerBase" - This tomcat API gives methods to get information.
But I don't know how to associate this manager with the tomcat i am using.
please If any of you know about this please tell me.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Since this thread is specific to Tomcat...
Moving to the Apache/Tomcat forum.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12682
    
    5
But I don't know how to associate this manager with the tomcat i am using.

Which version of Tomcat are you using?
In my copy of Tomcat5.5.9 the directory
CATALINA_HOME\server\webapps
contains admin, host-manager and manager applications which I can access online because I defined a user with the admin and manager roles.
Bill


Java Resources at www.wbrogden.com
Mamatha K S
Greenhorn

Joined: Jul 17, 2006
Posts: 2
I am using Tomcat 5.5.
Even I have manager and host manager application that I can access.

My requirement is : My application is running remotely. so I want to test how many sessions are creating and their execution time.
So I want to develop one Jsp page which gives me this info. Then this page i will deploy in a server where my application is running. Then I want use some tools like Wget which retrives that page thru HTTP.

Like this I can get session related information....

I am trying to use apache tomcat API..

but i am not getting how to use it..
I hope u can understand..

Thanks,
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60059
    
  65

"Mamatha K S",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
JavaRanch Sheriff


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12682
    
    5
If the management interface works you should be able to get the results of any manager command as a text stream with a simple URL. See this documentation.
Seems to me that parsing this text stream will be simpler than your proposed route through JSP.
Bill
[ July 17, 2006: Message edited by: William Brogden ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to get Session count from container
 
Similar Threads
Active Sessions
tomcat 4.0 question
Retrieving all active sessions at shutdown.
How many Session Objects ??
Do sessions use hashing?