皆さん、今晩は
logout.jsp コードを修正する方法についてサポートが必要です。MVCを使用しています。私の問題を抽出するために、私の問題は、この SidePannel.jsp と Content.jsp が index2.jsp 内に配置されていることです。SidePannel.jsp には、Content.jsp でリンクされているリンクが含まれています。Content.jsp は、SidePannel.jsp でクリックされたリンクに応じて、対応する値を表示します。問題は、logout.jsp を実装するたびに機能することですが、Content.jsp のみで、login.jsp へのリダイレクトが content.jsp に表示され、Sidepannel.jsp が残り、引き続き機能します。login.jsp でシステム全体を完全にリダイレクトする方法はありますか? LogOut.jsp リンクはどこに置くのですか?
今までやってきたことに対して。
LogOut.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>El Tres</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<%
if(session.getAttribute("username")== null || session.getAttribute("username").equals(""))
{
session.invalidate();
response.sendRedirect("login.jsp");
response.setHeader("Pragma", "No-cache");
response.setHeader("Cache-Control", "no-cache");
response.setHeader("Cache-Control", "must-revalidate");
response.setDateHeader("Expires",-1);
}
%>
</body>
</html>
SidePanel.jsp
<body>
<%
String role = (String) session.getAttribute("userRole");
if(role.equals("Admin")){
%>
<jsp:include page="SidePanelAdmin.jsp"/>
<%
}
else
{
%>
<jsp:include page="SidePanelFaculty.jsp"/>
<%
}
%>
</body>