aspose file tools
The moose likes Servlets and the fly likes time to wait before next submission 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 » Servlets
Reply Bookmark "time to wait before next submission" Watch "time to wait before next submission" New topic
Author

time to wait before next submission

nathan sullivan
Greenhorn

Joined: Dec 20, 2010
Posts: 3
Hi,

how can I implement a feature on the server side where after a user clicks submit for the first time, clicking submit again will bring the user to a page showing "Please wait X seconds to submit". I've seen this feature on several sites but can't resources on it.

Thanks.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16483
    
    2

When the user clicks submit, store the current time in the user's session. The next time they click submit, compare the current time to the time last stored in the session. If the difference is less than X seconds, redirect to the page which tells them to wait.
Piyush Mangal
Ranch Hand

Joined: Jan 22, 2007
Posts: 196
You can show a div with a Waiting GIF image on page submit. As soon as response from the server comes , browser will display the next page.
nathan sullivan
Greenhorn

Joined: Dec 20, 2010
Posts: 3
Thanks Paul. Can this be all done in the servlet or must I use some listener?
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: time to wait before next submission
 
Similar Threads
entity bean writes many records
wait script after clicking submit button
Multiple-submit prevention in JSF
ExecutorService invokeAll - blocking?
Wanted: Design pattern for handling time consuming HTTP requests