All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface org.apache.tomcat.core.RequestInterceptor

public interface RequestInterceptor
Provide a mechanism to customize the request processing.

Author:
costin@dnt.ro

Variable Index

 o OK

Method Index

 o afterBody(Request, Response)
Called after the output stream is closed ( either by servlet or automatically at end of service )
 o authenticate(Request, Response)
Will extract the user ID from the request, and check the password.
 o authorize(Request, Response)
Will check if the user is authorized, by checking if it is in one of the roles defined in security constraints.
 o beforeBody(Request, Response)
Called before the first body write, and before sending the headers.
 o beforeCommit(Request, Response)
Called before the output buffer is commited
 o contextMap(Request)
Will detect the context path for a request.
 o getMethods()
Will return the methods fow which this interceptor is interested in notification.
 o postService(Request, Response)
Called after service method ends.
 o preService(Request, Response)
Called before service method is invoked.
 o requestMap(Request)
Handle mappings inside a context.

Variables

 o OK
 public static final int OK

Methods

 o contextMap
 public abstract int contextMap(Request request)
Will detect the context path for a request. It need to set: context, contextPath, lookupPath A possible use for this would be a "user-home" interceptor that will implement ~costin servlets ( add and map them at run time).

 o requestMap
 public abstract int requestMap(Request request)
Handle mappings inside a context. You are required to respect the mappings in web.xml.

 o authenticate
 public abstract int authenticate(Request request,
                                  Response response)
Will extract the user ID from the request, and check the password. It will set the user only if the user/password are correct, or user will be null. XXX what should we do if the password is wrong ?

 o authorize
 public abstract int authorize(Request request,
                               Response response)
Will check if the user is authorized, by checking if it is in one of the roles defined in security constraints. This will also work for "isUserInRole()". If the user is not authorized, it will return an error code ( 401 ), and will set the response fields for an internal redirect. ContextManager will take care of handling that.

 o preService
 public abstract int preService(Request request,
                                Response response)
Called before service method is invoked.

 o beforeBody
 public abstract int beforeBody(Request request,
                                Response response)
Called before the first body write, and before sending the headers. The interceptor have a chance to change the output headers.

 o beforeCommit
 public abstract int beforeCommit(Request request,
                                  Response response)
Called before the output buffer is commited

 o afterBody
 public abstract int afterBody(Request request,
                               Response response)
Called after the output stream is closed ( either by servlet or automatically at end of service )

 o postService
 public abstract int postService(Request request,
                                 Response response)
Called after service method ends. Log is a particular use

 o getMethods
 public abstract String[] getMethods()
Will return the methods fow which this interceptor is interested in notification. This will be used by ContextManager to call only the interceptors that are interested, avoiding empty calls. ( not implemented yet )


All Packages  Class Hierarchy  This Package  Previous  Next  Index