I have a Login jsp that takes user email and sends it to servlet. If the email is not in database, the servlet redirects back to Login.jsp with an attribute "error". In the Login.jsp header I already have a scriplet that checks for this attribute and if it is set, it makes error msg div "display: block", else it makes "display:none". In this error msg I have a button with javascript to redirect to register page.
My Problem is: If I press browser back button when in register page, it shows login page still with the error message. I want it to instead show login page without error msg div.