JSP to achieve the system login after the exit principle and code

  • 2020-06-01 10:47:41
  • OfStack

The first thing to do is to put a hyperlink somewhere on the page where you're logged in:
 
<a href="exit.jsp" target="_top"> exit </a> 

Have it link to the exit.jsp page, and create a new exit.jsp page with the following code in its body:
 
<% session.invalidate(); %> 
<jsp:forward page="login.jsp"></jsp:forward> 

First log it off session, then jump to the login page, of course, you can write the page you want to jump to!

Related articles: