FreeKB - JSTL - Session ID
JSTL - Session ID

Home > Search


The following markup can be used to display the Session ID.

<c:out value="${pageContext.session.id}"/>

 

The following choose / when / otherwise statement can be used to do something based on whether or not there is a session ID.

<c:choose>
    <c:when test="${not empty pageContext.session.id}">
        Your session ID number is <c:out value="${pageContext.session.id}"/>
    </c:when>
    <c:otherwise>
        Sorry. There is no session ID.
    </c:otherwise>
</c:choose>	

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter in the box below so that we can be sure you are a human.




Comments