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 に答える