You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Joe Germuska <Jo...@Germuska.com> on 2004/02/19 20:04:34 UTC

Re: How to create a "No Action" ActionForward for return from an Action's execute() ?

At 12:46 PM -0600 2/19/04, Brad Balmer wrote:
>While you can use a filter to do this, why not extend the 
>RequestProcessor class?
>By overriding the processPreprocess function you can check for your 
>flag.  If found simply return true to continue processing. 
>Otherwise forward the user onto the login page.

I thought about suggesting this, but in processPreprocess, it might 
be complicated for the logic check to know whether the person is 
approaching an action which required a valid session.  Doing it in 
the Action means you have the ActionMapping as a very easy place to 
hang information about whether or not validation is required.

If you can structure your app so that you can do a check like this 
based on a URL fragment, then using a ServletFilter or extending 
RequestProcessor are good ideas -- in fact, better, if you ask me, 
because then you don't burn your single inheritance for your Action 
classes.

Joe

-- 
Joe Germuska            
Joe@Germuska.com  
http://blog.germuska.com    
       "Imagine if every Thursday your shoes exploded if you tied them 
the usual way.  This happens to us all the time with computers, and 
nobody thinks of complaining."
             -- Jef Raskin

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