cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MTiffan...@aol.com
Subject How to send redirect from an XSP?
Date Wed, 21 Aug 2002 04:07:38 GMT
hello all,

i'm trying to check to see if a user is in a session, and if not, redirect 
them to a login page...

my (rather sloppy) code so far goes like so...

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsp:page language="java"
  xmlns:session="http://apache.org/xsp/session/2.0"
  xmlns:xsp="http://apache.org/xsp"
  xmlns:xsp-request="http://apache.org/xsp/request/2.0"
  create-session="false">

    <xsp:logic>

    protected void checkUser()
    {
     if(!getSession())
       { 
             //SEND REDIRECT...
         }
    }

    protected boolean getSession()
    {
      Session session=request.getSession(false);
        if(session == null)
        return false;
        else
        return true;
        
    }
    </xsp:logic>

so, anyone care to share with me the secret of sending a redirect? I've 
checked out the response stylesheet and that was of no help, and the action 
stylesheet is apparently "not for use in Generators"...

any and all help (exlcuding RTFM) welcome

Mime
View raw message