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 Sun, 01 Jun 2003 21:47:26 GMT
I think that's the ticket.

-Tim

Nikola Milutinovic wrote:
>  Simple question.
> 
> I have a JSP/Servlet combination in which Servlet is used to authenticate user and create
a session. A JSP page then checks for the existence of the session and reads neccessary ID
from it. I'm switching to JSTL and I'd like to switch to EL, now. Here is the old code, how
can I translate it to EL?
> 
> OLD CODE
> -------------
> <%@ page contentType="text/html; charset=windows-1250"
>          ...
>          session="true"
>          ...
> %>
> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
> <%@ taglib uri="http://java.sun.com/jstl/sql" prefix="sql" %>
> <%
> if (session.isNew()) {
>   response.sendRedirect( response.encodeRedirectURL( "Error.jsp?reason=Wrong+login" )
);
> }
> %>
> 
> NEW CODE (the only thing I can come up with)
> -------------------------------------------------
> <%@ page contentType="text/html; charset=windows-1250"
>          ...
>          session="true"
>          ...
> %>
> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
> <%@ taglib uri="http://java.sun.com/jstl/sql" prefix="sql" %>
> <c:if test="${empty sessionScope.userID}"/>
>   <c:redirect url="Error.jsp?reason=Not+logged+in"/>
> </c:if>
> ---------------------------------------------
> Anybody got a better idea?
> 
> 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