jsp page window closed exit the way to share
- 2020-06-15 10:05:22
- OfStack
1. Adopt javascript
<input type="button" value=" Close the window " onclick="javascript:window.close()">
Or:
<input type="button" value=" Close the window " onclick="window.close()">
<input type="button" value=" Close the window " onclick="java:window.close()">
2. Use HttpSession to clear session and log out of the current login.
<a href="logout.jsp" class="a1"> exit </a>
logout.jsp
<%
session.invalidate();
response.sendRedirect("index.jsp");
%>
Return to the index jsp