You can use a filter to intercept all requests to a particular URL pattern
and check for your object in session.

A filter is similar to a servlet in that it's a piece of code that gets
passed the request and response objects and operates on them; but it's
invocation is unique, because it's called by the container before honoring
the original request.

You can write your own filter or use something like www.securityfilter.org

Or, as Craig McClanahan wrote:

"subclass RequestProcessor and override one of the processXxx
methods to perform this check for you."

See his full post below.

HTH,

-Sasha

Craig's post:

> If you have followed the recommended Struts design practice of flowing
> *all* requests through the controller servlet, then it's really easy to do
> this -- subclass RequestProcessor and override one of the processXxx
> methods to perform this check for you.
> 
> If you have direct hyperlinks to JSP pages, then you can use a Filter if
> you're on a Servlet 2.3 or later container; otherwise, you're stuck having
> to modify your 60 pages.  If you have to modify things anyway, you're
> strongly encouraged to follow the recommended design pattern and flow
> things through the controller, so you can do things like this in one
> place.
> 
> Craig


On 8/20/03 8:46, "Andy Richards" <[EMAIL PROTECTED]> wrote:

> Hi, i have created a form and a action which checks to see if a user exists in
> my database and if so a value object is placed into the session. What i am
> unsure of is how to a action called everytime a request is made? Can i
> configure struts-config.xml to send all requests via an action to see if this
> session object exists, and if not redirect the user to the login page?
> 
> many thanks
> 
> Andy


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to