The article says:
"Prohibit caching of application pages. Insert
in your pages. A page would be considered expired right after it loaded from the server."
Does this mean that if I prevent caching, the double submit problem will be solved?
Thanks.
Duc Vo
Ranch Hand
Joined: Nov 20, 2008
Posts: 254
posted
0
sonia pandit wrote:
Does this mean that if I prevent caching, the double submit problem will be solved?
No, preventing caching has nothing to do with your problem.
When you refresh a webpage, the browser will ask the server for the page. If it was originally requested via POST method, the browser will send a POST request to the server for page, hence the problem. Now the solution is to Redirect the browser to another page using GET request, normally this page only displays result from the previous POST request, hence the pattern name Post-Redirect-Get (PRG Pattern). Have you tried the google link that I included in my previous post? You may want to ask JSF as another keyword as well.
Hope it help,
Duc
sonia pandit
Ranch Hand
Joined: Apr 19, 2008
Posts: 137
posted
0
Yes, thanks I read the PRG link. I understand that if you redirect a post request to a get request you can overcome double submit problems. But that is thoretically, I don't understand how to implement it in practice. In addition, we are not using Struts. We are using JSF.
I dropped the Listener class in our package, configured it in the faces-config.xml and it worked like a charm. Great!
Thanks,
Veena
sonia pandit
Ranch Hand
Joined: Apr 19, 2008
Posts: 137
posted
0
I do have one problem, after testing I found that the dialog page to which the navigation occurs if there is validations, does not pop up. This could be the change I made with the listener and the faces-config.xml. Any ideas?