can anyone help me? thanks
how to avoid duplicating submit of jsp ?
There are two jsp which i call 1.jsp and 2.jsp ; a method in a action.
in 1.jsp one should write his or her name in the blank and then click the "submit" button to skip to the method in which the name will be transferred to a database which i can't control. If it succeeds, at the end of the method it will findForward to 2.jsp. But if you click the backout button on IE or the backspace button on keyboard to 1.jsp and write another name in the blank and also click the "submit" button to skip to the method and then the 2.jsp , the name in the database will be changed which is not supposed.
thanks for your help!!!!
jjrainbow
[703 byte] By [
jjrainbowa] at [2007-11-27 5:33:28]

# 2
Welcome to web applications.
Why is the name not supposed to be changed?
You entered in a new name and pressed save, so it should save that name to the database right?
What would you expect to happen?
There are a few things you can do to try and stop this. None of them are foolproof though.
1 - After you "save" use a response.redirect() to display the result. That will mean if the user presses the "refresh" button, it won't resubmit the "save" event but the display one.
2 - Use a "token". Struts has support for this. Basically give every page a unique "token" every you serve it. Keep that token in session, and also have it in a hidden field on the page. When the page is submitted you can compare the token submitted to the one you are expecting in session, and if they are different you know the user has been using the back button.