It's not a secret anymore!
The moose likes Tomcat and the fly likes tomcat 5.0 session related problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "tomcat 5.0 session related problem" Watch "tomcat 5.0 session related problem" New topic

tomcat 5.0 session related problem

vianyrajnish rajnish
Ranch Hand

Joined: Apr 22, 2007
Posts: 70
hi all,

I have created a small application , which counts the total number of users entered the application(TU), and total current users(CU).

logic is:
I have created 2 context attributes - TU and CU initialized to zero.
and 1 session attribute with username -- "user"
When the user login,i am writing a listner class with overridden method sessionCreated(HttpSessionEvent). Within this method reading the CU and TU ,
and increment it by one.

testing: I will open one browser and make user to login. At that time CU and TU is incremented to 1.
I open onather browser and make one user to login... according to logic CU and TU should increment to 2, but it in not incrementing .why?

when I see the is just replacing the attribute "user" with new user login instead invoking the sessionCreated() method. [ using listeners ]

And the same program i tried with other computer .. its working fine.

Please suggest me ....something whether is it problem with Tomcat in handling the request{session in tomcat 5.0 ..are they fixed in next version}?

vinay rajnish
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

How are you opening the second browser?

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: tomcat 5.0 session related problem
jQuery in Action, 3rd edition