• 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

How to maintain session in swing?

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anyone tell me how to maintain session in swing desktop applications?
I want to maintain session for user logins and sessions to be invalidated when logout from application.
I know the session implementation in JSF. Is there a way to do this in swing?
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rahul, please BeForthrightWhenCrossPostingToOtherSites
http://www.java-forums.org/awt-swing/59480-how-maintain-session-swing.html
 
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The thing is, sessions in a web application are a way of coping with the fact that HTTP is a stateless protocol. But if you're in a desktop application, you can easily maintain the state as long as the application is running - just keep the data in memory. In a standalone application you don't need the concept of a session at all.

It might be different in a client-server setup. But even then, it's trivial for a client to maintain state.
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use a WindowListener to be notified when the frame is closed. You can use it to log the user out.
 
reply
    Bookmark Topic Watch Topic
  • New Topic