idzi
idzi

Reputation: 65

Check whether user is Logged In to Application (Appfuse Project)

How can I check whether a certain user is already signed into my application? I want to do this so I can redirect someone that tries to login using the same username to logout.

FYI: I use appfuse project generator.

Upvotes: 0

Views: 104

Answers (1)

Matt Raible
Matt Raible

Reputation: 8644

In a JSP, you can use the following to see if they're logged in:

<c:if test="${empty pageContext.request.remoteUser}">
    not logged in
</c:if>
<c:if test="${not empty pageContext.request.remoteUser}">
    logged in
</c:if>

Upvotes: 1

Related Questions