struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Josh <jkharnes...@gmail.com>
Subject Re: Subclassing ActionForward
Date Tue, 17 May 2005 23:12:46 GMT
Lee Harrington wrote:

>I want to check to see if the user is logged in before performing any
>action, and redirect to the login page if they are not.
>
>For example...they have a page open and their session times out....and
>then they click a button.  Right now an error occurs because they are
>no longer logged in.
>
>I wrote a bit of code that if I put it in the beggining of an action
>class...does just that.  But I don't want to have to put this in the
>front of each of my actions (particularly since I've already written a
>good portion of the app).
>
>Do I solve this by subclassing the action forward -- or in some other way?
>
>Lee
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>
>  
>
Lee,

    Have you considered implementing a simple servlet filter to 
accomplish this? Alternatively, you could extend the RequestProcessor 
and provide a custom implementation of the processRoles method. However, 
that seems a bit heavy handed for something a simple as checking if a 
user is logged in.

Josh

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


Mime
View raw message