This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes How to maintain session in swing? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "How to maintain session in swing? " Watch "How to maintain session in swing? " New topic
Author

How to maintain session in swing?

Rahul Raj cochin
Greenhorn

Joined: Mar 29, 2012
Posts: 9
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?
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4164
    
    3

Rahul, please BeForthrightWhenCrossPostingToOtherSites
http://www.java-forums.org/awt-swing/59480-how-maintain-session-swing.html


luck, db
There are no new questions, but there may be new answers.
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 3792
    
    1

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.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

You can use a WindowListener to be notified when the frame is closed. You can use it to log the user out.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: How to maintain session in swing?
 
Similar Threads
MainTain Session in swing
how to maintain data in distributed environment
session
How to maintain session in Swings application
How to maintain Session in Swing application using StatefulsessionBean