Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Get session attribute values from all activated session's

 
prasad guna
Ranch Hand
Posts: 46
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

i want to monitor all (Active) available sessins in my web application. Its possible in HttpSessionListener but i need to get
the attribute values from all sessions how is it possible.

here is the code for getting available sessions



i try this code for getting values..

error is here only.. can't possible to get values from particulor sessions.





hope exact suggession..
 
Ankit Garg
Sheriff
Posts: 9528
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are you basically trying to do?? Your ListenerDemo1 class implements only HttpSessionListener so it will not be notified of context initialization so don't expect that contextInitialized(ServletContextEvent e) method will be called. Also in the sessionCreated method, you are calling se.getValue("Name") method (which is depricated) on a new session. Now how is a new session supposed to have any attributes??
 
prasad guna
Ranch Hand
Posts: 46
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dear ankit,

i already imported that packages. my requirement is i need to monitor all currently active sessions in server side. That monitoring needs all sessions and values from all sessions (These sessions all are already created by users) all sessions have attribute name and values. So I how can I get values from those sessions.

regards
Prasath
 
Saifuddin Merchant
Ranch Hand
Posts: 607
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I not aware of anyways to get all the active sessions on the server - you could use listeners to update you when things happen on any user session but I don't think there is any mechanism to get all the active sessions.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Depending on your Servlet container there are usually monitoring tools supplied to view session activity. If its Tomcat see this. Assuming you know the names of the attributes in the session you can also get the values associated with them.
 
prasad guna
Ranch Hand
Posts: 46
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

thanks for reply

In my project run in shared server. So i can't access 'catelina _home ' and all server side files.I can't get authority to change that files.if this task is possible in tomcat "realm"
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If monitoring is not enabled then you can't use it I'm afraid.
 
prasad guna
Ranch Hand
Posts: 46
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



my shared server is resign. Their not provide authority to change any server side configuration files. so what about realm its also need the authority from shared server.

if its possible in dedicated server?

if i use any third party tool to do that...?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic