I am developing one application using jsp and spring.In this application,After click the logout button,it is redirected to login page.Then If we click on backbutton(or backspace), it is going to previous page.How to avoid this?
Printable View
I am developing one application using jsp and spring.In this application,After click the logout button,it is redirected to login page.Then If we click on backbutton(or backspace), it is going to previous page.How to avoid this?
Hello Sri,
If you wnt to stop the navigation from page 2 to page 1 ,then place the following piece of code in your page1.
<SCRIPT type="text/javascript">
window.history.forward();
function noBack() { window.history.forward(); }
</SCRIPT>
</HEAD>
<BODY onload="noBack();"
onpageshow="if (event.persisted) noBack();" onunload="">
It redirects your control to page 2 rather taking you to page1.
Regards,
Kartik.