i wondering are all this SessionListeners bound to som scope by container? What i mean is i know i can call the method from the calling code by:
but i thought,due to the fact that container is able to call the sessionCreated and sessionDestroyed he allready must have instantated an object of type HSessL. So my questions is do we have to instatiete it again via new HSessL() (whcih would be stupid ) or thoes the container makes it availabele so we r able to do something like:
Joined: Sep 02, 2005
You need to have getAccCount() method as static, otherwise u cannot get that number. When you have static method, with just class name, you can get the number of active users.
SCJA, SCJP, SCWCD, SCBCD, SCDJWS.
Joined: Sep 14, 2005
hi Rizwan, yes that is the onother way but as i sed, that container is able to call the sessionCreated and sessionDestroyed (and they r not STATIC) so he allready must have INSTANTIATED an object of type HSessL SOMEWHERE. I just thought the Sun-dudes make it also availabel to as mortall-coders.
Joined: Jul 20, 2005
the container does create the HSessL object but I don't believe that the container makes it available anywhere. You can do this in the sessionCreated method though with something like the following
Note that I have not tested any of this code, so it might have some errors in it, but you should have enough to get the idea.
and then get the object elsewhere with something like