Avoid form resubmission

Hi,A simple question. How do i avoid form resubmit, when refresh is clicked or back and fwd button is clicked.( Im using servlet.)Thanx in advance
[167 byte] By [icebreakera] at [2007-11-27 8:22:18]
# 1

You cannot prevent the resubmit because you cannot control what the user does with his browser. What you need to do is guard against a resubmit actually doing something a second time. You could add some sort of generated number to the form and mark on the server side that this number has already been processed. Then you can check for this when the form is being submitted and you can refuse to do the form action when the number is already marked.

gimbal2a at 2007-7-12 20:10:57 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
You can also disable the submit button onClick() using javascript. I'm not convinced this is a good idea, but I have seen it done.
es5f2000a at 2007-7-12 20:10:57 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...