方式一:頁面自動執(zhí)行
<%
session.removeAttribute("adminname");//清除session
out.println("<script>alert('您已成功 注銷 退出!');window.location.href=document.referrer;</script>");//回到首頁
%>
方式二:在jsp頁面中用按鈕方式
- <%String ref = request.getHeader("REFERER");%>
-
- <input type="button" name="returngo" value="返回上一頁"
- onclick="javascript:window.location='<%=ref%>'" >
方式三: 在servlet中