wood burning stoves
The moose likes Struts and the fly likes Refreshing causing another submit request Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Refreshing causing another submit request" Watch "Refreshing causing another submit request" New topic

Refreshing causing another submit request

sreenath reddy
Ranch Hand

Joined: Sep 21, 2003
Posts: 415

I had used frames in my application and the thing is that i have some operation which opens a popup and i will submit that popup and close it and th e result of that operation will be appearing in the main window(mean the target will be the parent window)

but what happens after this operation is done ,right click on the parent frame and say refresh .this calls the old operation leading to duplicate entries in DB r some unwanted things happening

is it my responsibility to handle this at the server side r is there any easy way of over coming this ??
Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
You could try to use a token in the HttpSession to keep track of whether you've already processed the request or not (i.e. whether you should just skip to rendering the UI). Another option would be to check out these two articles:

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Anand Gondhiya
Ranch Hand

Joined: Feb 24, 2004
Posts: 155
google for the word "saveToken"
you shd get everythign. I just used it few days back
Anand Gondhiya
Ranch Hand

Joined: Feb 24, 2004
Posts: 155
struts has this token functinoality.

2 token function calls......and you will be done !!!
I agree. Here's the link: http://aspose.com/file-tools
subject: Refreshing causing another submit request
It's not a secret anymore!