Session Management
Hello,
I am using tomcat 5.5 and I want to manage my sessions so that I can
have a method like getSessions()... or set a constrain on a session
parameter, like session.getAttribute("user").setLimit(1);
Is this handled internally (J2EE API) or do I need tomcat libraries to do
that?
I have browsed around but probably I am not using the correct search terms, so even a search term will help.
Thanx,
John
[458 byte] By [
johndel6a] at [2007-10-2 6:15:53]

You want an HttpSession to know about other HttpSessions? They should not know about one another. If you "really" need this functionality, you'll likely have to modify the servlet container yourself. I don't know what you are trying to do, but perhaps there is another way to get the functionality you are trying to code.
Good luck.
Thank you for your answer....
Basically what I am trying to do is to identify:
1.How many sessions exist in my context?
2.Who do they belong to? (They may belong to a logged user which can
be found through the database or it may not).
Is there any common tecnique regarding session management or I have to just do it through the database.
Thanx again.
Hi,
we are using the struts and the method we had used to track the number of session
is to make a listener class that keeps track of the number of session made by the user
to do this
u need to implement the HttpSessionListener, HttpSessionAttributeListener
and do the required coding in the sessionCreated() method by a counter.
U had to register the listener in the web.xml
search the listener+web.xml on net
> Hi,> we are using the struts...whilst you may be using a struts-independent way of tracking users and their sessions, be mindful that not everyone uses or wants to use a framework. Best to have generic solutions.
Hi,its an generic solution,nothing to do with the Strutsfor any application u can define the listener in the web.xml, which can track the number of sessions.
> Hi,
>its an generic solution,
>nothing to do with the Struts
> for any application u can define the listener in
> in the
>web.xml, which can track the number of sessions.
Deepak, you are right. Declaring a listener in web.xml is generic. However, I just wanted to point out that some people only know how to do things within the context of a particular framework.
regards.