⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 welcome.jsp

📁 关于SESSION的程序例子
💻 JSP
字号:
<!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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -