1

下列的:

<% if ((String) session.getAttribute("userID") != null) { 
     String username= (String) session.getAttribute("userID"); %> 
     <li><a><small>Logged in as <%=username %></a></li> 
<% } %>

谢谢

4

1 回答 1

5

应该管用:

<c:if test="${not empty sessionScope.userID}">
  <li><a><small>Logged in as ${sessionScope.userID}</a></li>
</c:if>
于 2012-05-07T21:13:45.167 回答