struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Lipscombe" <>
Subject RE: logic:redirect not working (problem with dynamic jsp:include?)
Date Wed, 23 Jun 2004 14:12:25 GMT

I have discovered that if I use the <jsp:include> mechanism then the code
below does not work.
It does work if I use the <%@ include file="..." %> construct.

So, there appears to be a problem with using logic:redirect in a dynamically
included JSP? 

Any ideas?

TIA - Adam

-----Original Message-----
From: Adam Lipscombe [] 
Sent: 23 June 2004 13:48
To: 'Struts Users Mailing List'; 'Struts Users Mailing List'
Subject: logic:redirect not working


I am trying to implement a simple login gate to ensure a user is logged in.

My code is below. 
When a user is logged in successfully a session attribute named
"userContext" is present, and this has a property named "user". There is a
global forward called "login"


<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> <%@ page
import="com.expensys.expensyswt.resources.Constants" %> <%@ page
import="java.util.logging.Logger" %>

<"userContext = " +

<!-- Redirect user to login page if no UserContext found -->
<logic:notPresent name="userContext" property="user" scope="session" >
  <"not present");%>
  <logic:redirect forward="login" />


<jsp:include flush="false" page="common/LoginGate.jsp" />


I am puzzled. The redirect does not work.
The log statements indicate that the code block is being called - i.e. "not
present" is output.

Any ideas what is wrong?

TIA - Adam

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message