1
繼:如何編寫JSTL而不是Scriplets來獲取用戶會話?
<% if ((String) session.getAttribute("userID") != null) {
String username= (String) session.getAttribute("userID"); %>
<li><a><small>Logged in as <%=username %></a></li>
<% } %>
感謝
http://docs.oracle.com/javaee/1.4/tutorial/doc/JSPIntro7.html – jdevelop
這裏是如何使用JSTL獲取會話信息的例子(http://www.coderanch.com/t/525266/JSP/java/session-value-JSP-page-JSTL) – Rachel