This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes Handling double submit at server side, displays balnk page. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Handling double submit at server side, displays balnk page." Watch "Handling double submit at server side, displays balnk page." New topic
Author

Handling double submit at server side, displays balnk page.

Waez Ali
Ranch Hand

Joined: Jan 24, 2005
Posts: 43
Hi,

My aim is to display expected page to user and process his request only once despite double submits.

I am able to detect double submit using Token Synchronization and now my porblem is to handle the duplicat requests after I detect them. Please see the code below.

I tried saving the ServletResponse in session and locking it, when done with the first request other waiting threads would pick up the saved response object and will try to write its content through the response object of last submitted request.

But the successful If condition doesn't work as I thought of working...instead it displays blank page.




Please suggest.

Thanks.
Waez Ali
Ranch Hand

Joined: Jan 24, 2005
Posts: 43
Any input on this one please !! Would be much appriciated.


Regards,
Waez.
Ananth Chellathurai
Ranch Hand

Joined: Nov 21, 2007
Posts: 349

I would restrict double submit in the client side rather at the server side. http://www.willmaster.com/library/demo/singleclick.php could help you to do that.

Regards
Ananth Chellathurai


Ananth Chellathurai [Walk on software]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Handling double submit at server side, displays balnk page.
 
Similar Threads
JSF Filter prevent direct access certain page
Session Advice
Can I "cut" the chain in the filter?
no-cache not expiring web page
Using a filter to block access to certain web pages.