• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Get session attribute values from all activated session's

 
Ranch Hand
Posts: 46
Netbeans IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..
 
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Netbeans IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 608
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Netbeans IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Netbeans IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic