问题:frameset框架,在框架上一个页面有退出登陆的链接,现在点击这个链接能将session清空,但是跳转不是整个frameset跳到新页面,只是有退出登陆链接的那个页面跳转到了新页面.
解决:
protected void process(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String type = request.getParameter("type");
if(type != null && type.equals("logout")){
request.getSession().invalidate();
request.getRequestDispatcher("/logout.jsp").forward(request,response);
return;
}
}
logout.jsp
<%@ page
language="java"
contentType="text/html;charset=gb2312"%>
<%
out.println("<script>");
out.println("window.top.location.href='login.xhtml';");
out.println("</script>");
%>