tha*_*shd 1 java jsp jstl java-ee
以下:
<% if ((String) session.getAttribute("userID") != null) {
String username= (String) session.getAttribute("userID"); %>
<li><a><small>Logged in as <%=username %></a></li>
<% } %>
Run Code Online (Sandbox Code Playgroud)
谢谢
应该管用:
<c:if test="${not empty sessionScope.userID}">
<li><a><small>Logged in as ${sessionScope.userID}</a></li>
</c:if>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1398 次 |
| 最近记录: |