用session.get/setAttribute();返回值為null
?<%
? ? SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
? ? Date d = new Date(session.getCreationTime());
? ? session.setAttribute("username","admin");
? ? ?%>
? ? Session創(chuàng)建時(shí)間:<%=sdf.format(d) %><br>
? ? Session的id編號(hào):<%=session.getId() %><br>
? ? ? 從Session中獲取用戶名<%=session.getAttribute("uesrname") %><br>
2019-07-07
解決了,username,,單詞輸錯(cuò)了