File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Session Timeout Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Session Timeout" Watch "Session Timeout" New topic
Author

Session Timeout

Ah Ling
Greenhorn

Joined: Dec 28, 2009
Posts: 12
Hello all!

May I know is it possible to do a session timeout for my system in java?
My system is something to do with booking.
When the user reach last page(confirmation page) and if they never click on the ''Confirm" button, it will have session timeout and return back to the main page.
Any given example will be greatly appreciated!

Thanks!
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10535
    
    9

What has this question got to do with Swing?


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Ah Ling
Greenhorn

Joined: Dec 28, 2009
Posts: 12
I am so sorry as i do not know where to post it.
Sorry for the incovenient caused!
Which section should this thread move to?
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2227
    
    8
Use a Swing Timer. Schedule the Timer to fire in X milliseconds. If the timer fires then you cancel the session and go back to the start. If the "Confirmation" button is pressed, then you stop the Timer.

Read the section from the Swing tutorial on How to Use Timers.
Ah Ling
Greenhorn

Joined: Dec 28, 2009
Posts: 12
Rob Camick wrote:Use a Swing Timer. Schedule the Timer to fire in X milliseconds. If the timer fires then you cancel the session and go back to the start. If the "Confirmation" button is pressed, then you stop the Timer.

Read the section from the Swing tutorial on How to Use Timers.


Hey Rob Camick, Thanks for your guidance! I managed to solved it!!!
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19784
    
  20

To be honest, I don't think a Swing timer is a good solution in a non-Swing application. Since this is a web application, I would use a JavaScript timer or META refresh tag; if the page stays active for X seconds then call a new page which invalidates the session and goes to the main page. If the user does anything else (like press Confirm) the page is exited and the timer /refresh is never activated.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Session Timeout