• 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

Refreshing page resends information!

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

Ok i guess this problem is an old one at that! but i'm having trouble solving this problem.

So i have a payment page jsp..once the submit is clicked there is a Servlet capturing the request.The servlet send the request to the appropriate ejb, receives the object response and forwards to the new page. But once im on the new page (jsp) if i refresh the page the request is re-sent!

Is there a way of removing the data from the request before sending it back?! or something similar?

Any ideas will be much appreicated!

Regards
Nick
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nick,
There is a pattern called "post-redirect-get". The idea is that after a post/update operation, you redirect the user to a view page that uses a 'get' rather than a 'post'. This separates the two. When the user presses refresh, it only refreshes the get part which is harmless and doesn't re-update the database.
 
These are the worst of times and these are the best of times. And this is the best tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic