tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Funk <funk...@joedog.org>
Subject Re: Expression Language question
Date Mon, 02 Jun 2003 11:18:29 GMT
Ooops, sorry, I misread. How's this instead ...

<c:if test="${empty pageContext.session}">
   <!-- no session ?? weird .. redirect away ...-->
</c:if>

<c:choose>
   <c:when test="${pageContext.session.new}">
     <!-- My session is new -->
   </c:when>
   <c:when test="${empty sessionScope['user']}">
     <!-- No user yet -->
   </c:when>
   <c:otherwise>
     <!-- Profit! -->
   </c:otherwise>
</c:choose>


-Tim

Nikola Milutinovic wrote:
>>I think that's the ticket.
> 
> 
> Yes, Tim, but I'd like to be able to differentiate between "user not logged in" - session.isNew()
and "user logged in, but error in web-app" - !session.isNew() and session.getAttribute( "userID"
) == null.
> 
> Is there a way to call a method from EL? Like:
> 
> <c:set var="login" value="${session.isNew()}"/>
> 
> Or would this defeat the purpose of introducing EL?
> 
> Nix.
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message