Solving the Double Submission Issue

后端 未结 7 1024
暖寄归人
暖寄归人 2020-12-01 03:06

I would like to see how Web Developers avoid the double submission problem. So basically my understanding of the problem is as follows:

Double submission occurs whe

7条回答
  •  春和景丽
    2020-12-01 03:40

    If you are working with java server side scripting and also using struts 2 then you refer this link which talks about on using token .

    http://www.xinotes.org/notes/note/369/

    A token should be generated and kept in session for the initial page render, when the request is submitted along with the token for the first time , in struts action run a thread with thread name as the token id and run the logic whatever the client has requested for , when client submit again the same request, check whether the thread is still running(thread.getcurrentthread().interrupted) if still running then send a client redirect 503.

    Please look at the ExecuteAndWaitInterceptor of struts 2code, the logic of this combined with token will help out fast click

提交回复
热议问题