• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

IE refresh button problem

 
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I click on the refresh in IE7, it causes a submit to happen(an apply button). Is this event called Post-back and can it be prevented?

Thanks in advance,

Veena
 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, there is a solution for your problem. It's called PRG Pattern.
 
sonia pandit
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How do I do something like this in JSF:

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
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 137
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Veena.
 
Duc Vo
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What about this one http://www.google.com/search?q=PRG+pattern+%2BJSF
 
sonia pandit
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 137
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?

Thanks,

Veena
 
I wasn't selected to go to mars. This tiny ad got in ahead of me:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic