tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Assaf Arkin <ar...@exoffice.com>
Subject Re: Help with Interceptors
Date Thu, 10 Feb 2000 19:32:38 GMT
> The scenario is as follows:
> 
> a. a user should always access our web-enabled application through a
>    '/login' servlet
> 
>    That servlet performs user validation, role association, session
>    establishment
> 
> b. If a request to a servlet arrives that indicates that the user has not
>    performed prior validation (determined by inspection of the HttpSession
>    object), I would like to do a forward of the request to the '/login'
>    servlet.

You should be looking at the deployment descriptor to specify /login as
the login form and force all new sessions to go through it. No need to
write an interceptor for something as generic as that.

arkin


> 
> 
> If the current scenario of execution is as follows (mostly taken from
> the ServletWrapper.handleInvocation()):
> 
>         interceptor.preInvoke(context, servlet, req, res)
> 
>         servlet.service(req, res)
> 
>         interceptor.postInvoke(context, servlet, req, res)
> 
> 
> I would like to have a scenario that would allow me to do the following.
> 
>         Servlet routed = interceptor.preInvoke(context, servlet, req, res)
> 
>         if (null != routed)
>            routed.service (req, res)
>         else
>            servlet.service (req, res)
> 
>         interceptor.postInvoke (context, servlet, req, res)
> 
> So, what I would like to have in place is an interceptor that optionally
> perform re-routing of the request.
> 
> ---
> 
> It should also be possible to re-evaluate the servlet to execute based on
> modification of the request object:
> 
>         interceptor.preInvoke (context, servlet, req, res);
> 
>         Servlet newServlet = reEvaluate (req);
> 
>         newServlet.service(req, res);
> 
>         interceptor.postInvoke (context, servlet, req, res);
> 
> ---
> 
> Perhaps I am missing something, and there is already a collection of
> class methods that allows me to accomplish the same.
> 
> Ideas ??
> 
> Suggestions ??
> 
> ---
> 
> Arieh
> --
>  Arieh Markel                           Sun Microsystems Inc.
>  Network Storage                        500 Eldorado Blvd. MS UBRM11-194
>  e-mail: arieh.markel@sun.COM           Broomfield, CO 80021
>  Let's go Panthers !!!!                 Phone: (303) 272-8547 x78547
>  (e-mail me with subject SEND PUBLIC KEY to get public key)
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org

Mime
View raw message