• Post Reply Bookmark Topic Watch Topic
  • New Topic

Refreshing page resends information!  RSS feed

 
Nicky Formosa
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • 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
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36446
454
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!