aspose file tools*
The moose likes Servlets and the fly likes Get session attribute values from all activated session's Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Get session attribute values from all activated session Watch "Get session attribute values from all activated session New topic
Author

Get session attribute values from all activated session's

prasad guna
Ranch Hand

Joined: Feb 12, 2009
Posts: 43

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..


Prasath.G
SCJP
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9305
    
  17

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??


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
prasad guna
Ranch Hand

Joined: Feb 12, 2009
Posts: 43

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

Joined: Feb 08, 2009
Posts: 606

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.


Cheers - Sam.
Twisters - The new age Java Quiz || My Blog
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

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.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
prasad guna
Ranch Hand

Joined: Feb 12, 2009
Posts: 43

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

Joined: Apr 14, 2004
Posts: 10336

If monitoring is not enabled then you can't use it I'm afraid.
prasad guna
Ranch Hand

Joined: Feb 12, 2009
Posts: 43




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...?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Get session attribute values from all activated session's