How to prevent duplicate entries while refreshing?

sWonswerese

New Member
I have a \[code\]index.jsp\[/code\] page where I have a form where user enters some data that get stored in the database using a Controller servlet.I want to display the same page (\[code\]index.jsp\[/code\]) with that form after entering the data in the database.Also I want to display all the entries that the user entered in the database.I tried using \[code\]forward()\[/code\] method of \[code\]RequestDispatcher\[/code\] it works fine ( meaning I am able to display that same form again and also display all the data entered by that user below the form using JSTL).But the problem is whenever user presses \[code\]Refresh or F5\[/code\] button all the previous data also gets entered in the database and as I am displaying all the data, that duplicate entries also come up.I thought of using POST-REDIRECT-GET pattern but the problem is when I redirect I don't get those data to be displayed using JSTL.Can anyone suggest how to do it.
 
Back
Top