Handling Multiple Submits
Subject:   this does not solve the problem
Date:   2003-04-16 07:02:33
From:   anonymous2
the problem occurs often when inserting rows in a dabatase etc.

the solutions in this article are not sufficient

A) javascript: may be deactivated, what about the refresh button?

B) sessions: you can' t use sessions any more, because you always expect a new session to do the form action! Also its impossible to use the form later in your app...

the idea seams nice:

0) user on form-page clicks button

1) servlet checks a (POST or GET) form-request

2) if its new: do the action; if not: do nothing

3) then send a redirect to another page

4) browser submits a new GET request

5) browser gets a result page

6) refresh button gives this result page
back button goes back to form page (!)

next problem: how do you prepare the result page? you have to attach the result to the session ...

Main Topics Oldest First

Showing messages 1 through 1 of 1.

  • this does not solve the problem
    2003-05-26 09:22:01  anonymous2 [View]

    " you have to attach the result to the session .."

    Use a servlet filter to encapsulate the actual response and put the result on the session using some unique key. Subsequent requests are then connected to the first one using the same filter.