struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Struts Newsgroup ( <>
Subject Re: Forward after <check-login>
Date Wed, 24 Apr 2002 00:55:01 GMT
Subject: Re: Forward after <check-login>
From: "Dave Barber" <>
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.


David Barber
JForms - Rapid Struts-based Web forms development

> 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:   <>
For additional commands, e-mail: <>

View raw message