You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bryan Ross <Br...@astarte.co.nz> on 2001/09/18 05:55:53 UTC

processPreprocess

Hi there,

I'm trying to implement some common authentication behaviour.  To do
this, I've implemented my own ActionServlet and overrided the
processPreprocess method.  In this method, I want to check to see if the
user is authenticated.  If they are, the processing should continue as
normal.  If the user is not authenticated, I want to redirect them the
logon page.

How is this accomplihsed within the processPreprocess method?  How do I
change the page that is to be displayed?

Regards,
Bryan

Re: processPreprocess

Posted by Robert Parker <ro...@racv.com.au>.
I did a similar thing, except I derived my own action class from the Action
class. Hence my perform() method checks for a session based token indicating
successful login. If the token does not exist, the action uses a struts
forward to redirect to an initialisation page. If the token exists, then
this method just delegates to another abstract method (I called it execute)
which all derived classes must implement. Hence I have effectively
re-packaged the Action class with a common check for each action.

On my initialisation page, I use container based security...

Not an answer to your question, but an alternative view.

regards

Rob

----- Original Message -----
From: "Bryan Ross" <Br...@astarte.co.nz>
To: <st...@jakarta.apache.org>
Sent: Tuesday, September 18, 2001 1:55 PM
Subject: processPreprocess


> Hi there,
>
> I'm trying to implement some common authentication behaviour.  To do
> this, I've implemented my own ActionServlet and overrided the
> processPreprocess method.  In this method, I want to check to see if the
> user is authenticated.  If they are, the processing should continue as
> normal.  If the user is not authenticated, I want to redirect them the
> logon page.
>
> How is this accomplihsed within the processPreprocess method?  How do I
> change the page that is to be displayed?
>
> Regards,
> Bryan