My
JSP has a form which collects request information.
The form has a SUBMIT button. Once user hits this
button, it calls a
servlet, which in turn goes to
database to process information and output results.
Usually,it takes a while to for the servlet to do
the calculation. If, while the servlet is doing the
heavy calculation, the user hits the SUBMIT button
again, another request will be sent to the servlet
again, etc. If user keeps hitting the SUBMIT button
before the servlet ever returns the results, the
program could be in trouble, the servlet may be busy
fending off all the unnecessary & duplicate requests
from the user.
I need a way to get around this. I can think of two
general ways:
(1) make sure when the user hits the SUBMIT button once,
the button will be disabled so that he/she cannot
hit it again.
(2) alternatively, somehow in the servlet, don't process
repeat requests from the same source within a certain
period of time.
How can I implement any of the above two ways in JSP/SERVLET?
I would appreciate your comments and suggestions.
Sam