If all you want is the possibility to use <c:if>
you must have a scoped variable. Attributes of current request, session of application context are with respective scope being request, session and application.
You can easily put variables in page context (valid only for the current jsp, and others included by @include
but not by <jsp:include>
) :
<%
...
String statut = useraction.Connect();
pageContext.setAttribute("statut", statut);
%>
<c:if test="${statut == 'ADMIN'}">
...
</c:if>
But if you want to to many excluvise test the correct tag is <c:choose>
:
<%
String statut = useraction.Connect();
pageContext.setAttribute("statut", statut);
%>
<c:choose>
<c:when test="${statut eq 'ADMIN'}">
...
</c:when>
<c:when test="${statut == 'USER'}">
...
</c:when>
<c:otherwise>
<p>Status ${statut} not found</p>
</c:otherwise>
</c:choose>
I've just tested it it works (on my machine ...), and the otherwise clause could explain why you do not get what you want.