• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

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: 42134
937
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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic