You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Chuck Cavaness <ch...@attbi.com> on 2002/06/04 05:19:01 UTC

Re[2]: related to: Re: #2 - Use DispatchAction to organize related operations

The processPreprocess() method has the request and response as arguments, 
so you should be able to get everything you need. Remember, the method 
returns a boolean that tells the RequestProcessor whether it should 
continue to process the request or not. If you find that the user is not 
logged in, you'll need to return false, but also redirect the user 
manually. You can still get access to the GlobalForwards and such; it's 
just that you'll need to take care of the redirecting part. You can call 
the processActionForward() method and pass it the ActionForward for the 
login page, for example.

Chuck

At 11:04 PM 6/3/2002 -0400, you wrote:
>On Monday, June 3, 2002, 10:58:07 PM, Chuck Cavaness wrote:
>
>CC> What I suggest is to look at the processPreprocess() method in the
>CC> RequestProcessor and possibly override this to do your checks. It's 
>called
>CC> for every request and long before ActionForm's are populated and Action's
>CC> are invoked. The default value is to return true, which allows request
>CC> processing to continue. What I've done in the past is to override this,
>CC> check the login, and possibly redirect the user to the login page. If the
>CC> user's logged in, just return true to continue processing the request.
>
>     Excellent idea. Thanks. You are right I wouldn't even want form
>     validation to take place if they weren't logged in ( which would
>     be allowed to happen if I only checked in the action ). I take it
>     I'll have access to the session as well inside of
>     RequestProcessor, because if I go this route I will also need to
>     check for particular roles that will be stored in a UserBean put
>     in the Session and possibly deny or grant access based on these
>     roles.
>
>--
>
>Rick
>
>mailto:maillist@reumann.net
>
>"I wish I had a dollar for every time I spent a dollar, because then,
>Yahoo!, I'd have all my money back."
>   -Jack Handey
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>