welcome.jsp
来自「关于SESSION的程序例子」· JSP 代码 · 共 24 行
JSP
24 行
<!doctype html public "-//w3c//dtd html 4.0 transitional//en" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html>
<body>
Welcome to logon appA:
<%= request.getRemoteUser() %>! <br>
<% if(request.getUserPrincipal() != null)
{
out.println("User" + request.getUserPrincipal().getName() + " login.");
} else{
out.println("missing login user info!");
}
%> <br>
<a href=/appB/welcome.jsp>go to appB</a><br></br>
session info:
<%session.setAttribute("appA.app", "appA");%><br>
session id=<%=session.getId()%><br>
appA=<%=session.getAttribute("appA.app")%><br>
appB=<%=session.getAttribute("appB.app")%>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?