Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Refresh problem while doing transaction  RSS feed

 
rushikesh kale
Ranch Hand
Posts: 41
Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

I wrote a program for online banking and I used mvc model 2 approach for that,I have refresh problem while doing withdrawal and deposit:

First let me explain how this transaction of withdrawal takes place:

In my JSP page user enters amount to be withdrawn -> control gets transfered to transactionController servlet -> Controller servlet create object of transaction javabean and calls method withdraw of using that object.
After successful withdrawal servlet store the new account information in session and again transfer control back to same jsp page with new account balance -> jsp page displays new account balance.

Now problem is, If I refresh this Account balance jsp page, previous transaction takes place again and amount gets withdrawn again.

Can you please tell me, what is wrong in my logic, and what should i do to avoid this re transaction.

Here is Code Snippet from my transaction controller servlet:


waiting for response
Thanks!
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read this article and pay particular attention to the Post-Redirect-Get (PRG) pattern.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!