Submits again

Posted on 2006-03-24
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
Question by:rea_19
    LVL 8

    Expert Comment

    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.
    LVL 8

    Accepted Solution

    LVL 35

    Expert Comment

    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 :-)

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    Suggested Solutions

    In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
    Exchange server is not supported in any cloud-hosted platform (other than Azure with Azure Premium Storage).
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    745 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

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now