Folks,

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"


LoginGate.jsp:

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

<%logger.info("userContext = " +
session.getAttribute(Constants.USER_CONTEXT));%>

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


Home.jsp

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

<html:html>
[snip..]



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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to