測試分佈式部署頁面sso
index.jsp
----------
<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>無標題文檔</title>
</head>
<body>
<h1>這個是第1個頁面</h1><br>
<%
if (session.getAttribute("ss") == null) {
session.setAttribute("ss", "page1 session");
}
out.print("session ss is " + session.getAttribute("ss").toString()+"<br/>");
out.print("session id is " + session.getId());
%>
</body>
</html>
----------
clearSession.jsp
----------
<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>無標題文檔</title>
</head>
<body>
<h1>這個是第1個頁面</h1><br>
<%
if (session.getAttribute("ss") != null) {
session.removeAttribute("ss");
}
%>
session is clear.
</body>
</html>
----------
html