Meaningless Drivel is fun!*
The moose likes Struts and the fly likes sessions in Struts 1.3 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "sessions in Struts 1.3" Watch "sessions in Struts 1.3" New topic
Author

sessions in Struts 1.3

Mamata Chaudhari
Greenhorn

Joined: Apr 26, 2009
Posts: 23
Hi,
I am using Struts 1.3, i want to know is there any method which will tell me
how may session attributes i have maintained in my whole application.
I have used


In many times in my code now i want to remove all those session at the time of Log off

how can i?
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9291
    
  17

how may session attributes i have maintained in my whole application

You can get the names of all session attributes in a particular session using HttpSession.getAttributeNames() method.
In many times in my code now i want to remove all those session at the time of Log off

Do you want to remove all the sessions or session attributes?? Generally when a user logs off, the session is ended using HttpSession.invalidate(), this removes all the attributes from the session and kills the session itself...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Mamata Chaudhari
Greenhorn

Joined: Apr 26, 2009
Posts: 23
thanks for reply......
but for enterprise log in i don't want to invalidate session.
i will remove unnecessary session
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I don't understand why you wouldn't just invalidate the session.
 
wood burning stoves
 
subject: sessions in Struts 1.3
 
Similar Threads
Open new window throught struts action
session
session in struts1.3
Struts 1.3: declare action form attribute to be transferred through request
How to Retrieve a Servlet Session variable in PHP