Meaningless Drivel is fun!*
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
Author

Refreshing causing another submit request

sreenath reddy
Ranch Hand

Joined: Sep 21, 2003
Posts: 415
Hi

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
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
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:
RedirectAfterPost
RedirectAfterPost2


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 !!!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Refreshing causing another submit request
 
Similar Threads
Popup Question
could't access DIV TAG attribute
dynamic DIV tag
input from a new window
Parent form reload