Results 1 to 3 of 3
  1. #1
    anki1234 is offline Member
    Join Date
    Dec 2007
    Posts
    28
    Rep Power
    0

    Exclamation Bug in refreshing jsp

    I have a JSP which insert into database but when I refresh the same JSP with the same fields it agains insert the values.Can anyone help me out?
    It would be very helpful.
    Thanks & Regards,
    Ankit

  2. #2
    wsaryada is offline Senior Member
    Join Date
    Jun 2007
    Location
    Bali, Indonesia
    Posts
    757
    Rep Power
    8

    Default

    You can implement the pattern called Redirect-After-Post, this can help you to prevent the double submit as you mention above. Basically when you submit your data, insert it into the database then redirect it to the form again or to the other page. And if you redirect it back to the form it will become an empty form, so refresh the page won't re-submit your previous data.

    Here is an example how to implement it from Javaranch PostRedirectGet

  3. #3
    anki1234 is offline Member
    Join Date
    Dec 2007
    Posts
    28
    Rep Power
    0

Similar Threads

  1. how to stop refreshing page
    By cecily in forum New To Java
    Replies: 1
    Last Post: 07-24-2007, 01:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •