• 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

Deleting session

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How to delete entired session.

I have two managed bean with session scope user bean and admin bean.I want to invalidate only user bean.What code snipped i should use.
If i use session.invalidate(),both bean are deleted.

Thanks you very much for saloon.javaranch.com's helps.

Please help me.
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually, when you do session.invalidate(), you DO delete the entire session and all the session variables.

You can delete an individual session object by obtaining the HttpSession and calling its removeAttribute method. However, I'm not sure what the consequences of doing this on a managed session-scope bean might be. Non-managed session-scope beans would be OK.
 
reply
    Bookmark Topic Watch Topic
  • New Topic