[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Submits again

Posted on 2006-03-24
3
Medium Priority
?
183 Views
Last Modified: 2010-04-01
In order to add some data I forward my page to a servlet which calls a bean to add new entry and finally servlet forwards to a new page. If at that  page user refreshes page then a duplicate entry is entered in the database. What to do to avoid it
0
Comment
Question by:rea_19
  • 2
3 Comments
 
LVL 8

Expert Comment

by:thomas908
ID: 16278666
After processing, use response.sendRedirect() to forward to the next  page.
This load the page from a new request, and refreshing the page will only reload the page without resubmitting the data.
0
 
LVL 8

Accepted Solution

by:
thomas908 earned 1000 total points
ID: 16278685
0
 
LVL 35

Expert Comment

by:TimYates
ID: 16278728
Thomas is correct...  Just to clarify his point (please don't accept this comment as an answer), you do:

  Form.jsp     ---POST--->    Processing.jsp    ---REDIRECT--->   Thanks.jsp

Then the user can't go "back" to the Processing.jsp, so can't resubmit thir form :-)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

LinkedIn blogging is great for networking, building up an audience, and expanding your influence as well. However, if you want to achieve these results, you need to work really hard to make your post worth liking and sharing. Here are 4 tips that ca…
Tech giants such as Amazon and Google have sold Alexa and Echo to such an extent that they have become household names. And soon they are expected to be used by commoners in their homes, ordering takeout, picking out a song, answering trivia questio…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Integration Management Part 2

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question