java - How to prevent the user to go back on login page by clicking on back button of browser in jsp? -


i building web application in jsp through mvc approach! in app once user logged in through login.jsp page , redirected adminpanel.jsp if click button again can view login.jsp page. want once user logged in , click button or manually enter adminpanel.jsp url in browser must redirected adminpanel.jsp page! have done following login page. works after user manually enter url after logging in e.g localhost:8080/ert/login.jsp redirects adminpanel.jsp if logged in already. if press button dont redirect adminpanel.jsp go login.jsp..

<body> <%   if(session.getattribute("id")!=null) {     response.sendredirect("adminpanel.jsp"); } %>  <%!string errormsg; %> <form action = "adminlogin" method = "post">      username : <input type = "text" name = "username"/ ><br />     password : <input type = "password" name = "password"/><br />     <input type = "submit" value = "submit" />  </form> </body> 


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

c++ - Clear the memory after returning a vector in a function -

erlang - Saving a digraph to mnesia is hindered because of its side-effects -