测试分布式部署页面sso

测试分布式部署页面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>
----------

上一篇:单点登录 SSO


下一篇:OAuth 2.0和SSO