The best way I have found to do this is to use session/request Tokens.
This is standard practice for intercepting form resubmissions. Basically
you set a token in the request and in the session upon the start of a
transaction. On the following jsp, it has a hidden field with the token
value. When submitted (say to complete a credit card transaction), you
delete the token in the session. If the user hits back and tries to
resubmit, the values will no longer be the same and you can forward to
an error page or an index page. 

Struts makes this process very easy with built in token methods. Here
are a couple of sites that detail this:
http://www.learntechnology.net/struts-token.do
http://www.javaworld.com/javaworld/javatips/jw-javatip136.html




-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx]
On Behalf Of Joe Giusto II
Sent: Wednesday, January 25, 2006 3:32 PM
To: web400@xxxxxxxxxxxx
Subject: [WEB400] Prevent Brower From Going Back To Credit Card Page

I am trying to prevent users from using the Back button in the web
browser
to get back to the page where the credit card number was entered.  Or
alternatively, be able to erase that page from the history log or back
button log.

The closest I have come is with this JavaScript, which will throw the
page
forward again when the user hits the back button.

</script><script
language="JavaScript">javascript:window.history.forward(-1);</script>

But does not prevent them from using the drop down arrow on the back
button
to go back several pages to get to it.

I realize the script will work if I put it on each page, but I need to
allow
them to go back and make changes until the final order page is accepted
or
rejected.  That is when I write out a confirmation page with the script
in
it.




As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.