struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Struts Newsgroup (@Basebeans.com) <str...@basebeans.com>
Subject Re: Forward after <check-login>
Date Wed, 24 Apr 2002 00:55:01 GMT
Subject: Re: Forward after <check-login>
From: "Dave Barber" <dbarber@solanasoft.com>
 ===
One thing we've done is to have our *Actions* all extend a base Action class
(ie. SecuredAction).

SecureAction extends Action {
      public ActionForward perform( ServletRequest, etc...) {
            // check security, forward to login page, etc...
            if (checkSecurity() ) {
                return handleRequest( request, ...);
            }
      }

      public ActionForward handleRequest( ServletRequest, etc...) {
            // subclasses should override to do something....
      }
}

This way, you don't have to muck around with the servlet, and you kind of
stay in the "controller" or command framework.  Even better, you can
subclass from different "base" actions to get different behavior like
"Secured", "Logged", etc, actions.

--Dave

=====================================
David Barber
SolanaSoft
JForms - Rapid Struts-based Web forms development
www.solanasoft.com
=====================================

> I have some pages which require a user to be logged in
> and some which do not.  If the <check-login> tag
> determines that there is no user logged in, the user
> is forwarded to the login page.  I'd like to remember
> where the user came from and forward them there after
> a successful authentication.  I'm sure there are
> multiple ways of doing this and I would like some
> advice.  Thanks, Andrew Timm




--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message