aspose file tools*
The moose likes Struts and the fly likes Multiple Http Request Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Multiple Http Request" Watch "Multiple Http Request" New topic
Author

Multiple Http Request

Navi Lock
Ranch Hand

Joined: Jul 29, 2003
Posts: 39
Howdy Folks,
need your expertise on the below..
Issue is to 'prevent multiple submits' from the same page..
Meaning a user could possibly press the same button more than one time.

Cannot use Scripting.

Have tried using isTokenValid()/resetToken()/saveToken().
The above works.. i am able to differentiate between the first and the successive http request's.

Question is .. what to do with the successive request that come in ??
And at the same time the application is waiting for the underlying processes to be completed initiated due to the first request.

I still want the customer to see the result page only invoked due to the first 'submit'.
Is there a way to ignore the successive submit request's?

Thanks in advance,
-Navi

[ November 21, 2007: Message edited by: Navi Nav ]
[ November 21, 2007: Message edited by: Navi Nav ]
Navi Lock
Ranch Hand

Joined: Jul 29, 2003
Posts: 39
Guya,Any thing on the above q ?..

Thanks,
-Navi
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42913
    
  68
Have tried using isTokenValid()/resetToken()/saveToken().
The above works.. i am able to differentiate between the first and the successive http request's.

Question is .. what to do with the successive request that come in ??


That's a bit of a strange question to ask. You're able to differentiate between the first and any subsequent submits - great, that's what you want to be able to do. What exactly should happen for the second request is a matter of your business logic (or how user-friendly you want to be). So, "what to do with the successive request that come in" is a question for you.
Navi Lock
Ranch Hand

Joined: Jul 29, 2003
Posts: 39
HI Ulf, Thanks for responding..

I still want the customer to see the result page only invoked due to the first 'submit'.
Is there a way to ignore the successive submit request's?


That is what i wanted to do.. need to know how to do the above.

Thanks again,
-Navi
Navi Lock
Ranch Hand

Joined: Jul 29, 2003
Posts: 39
Any other suggestions guys ??

Thanks,
-Navi
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42913
    
  68
I still want the customer to see the result page only invoked due to the first 'submit'.
Is there a way to ignore the successive submit request's?


Once again, you said you knew how to differentiate between the first and subsequent requests. So what prevents you from ignoring subsequent ones?
Navi Lock
Ranch Hand

Joined: Jul 29, 2003
Posts: 39
Yes.. that is what i want to know..
How to ignore the subsequent requests..

what are/is the way to ignore the subsequent request's??
Or rephrasing - How to kill/nullify the subsequent request, while the first request is still being processed and hasn't reached a decision point.

I would like to show the result page based only on the first request only..


Thanks,
-Navi.
Java Chandu
Greenhorn

Joined: Dec 04, 2007
Posts: 1
I'm also facing same problem in following situations
1. If i want to show some exception on the same input page
2. In case is i have action to action forward

My page contains multiple 3-4 button which has different actions. I want to avoid multiple clicks also without javascript.
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
I missed this thread when it was first posted...I think I was out eating Turkey!

A few years ago I played with trying to get token working in my application to prevent double submissions. One of the major issues for me is the one mentioned in this thread. I ended up going with a client-side JavaScript solution that works good enough.

There is an article somewhere out there on the web that has a solution. It is a pretty complicated solution that involves storing data on the session. I tried a couple searches...hmmm...I found this article that might be it: http://www.javaworld.com/javatips/jw-javatip136.html?page=1

- Brent
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3716
    
    5

"Navi Nav"

Your name still does not conform to the JavaRanch Naming Policy. Please review the policy and update it appropriately. This is your second warning.

Scott Selikoff


My Blog: Down Home Country Coding with Scott Selikoff
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Multiple Http Request