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
-
OK
-
-
afterBody(Request, Response)
- Called after the output stream is closed ( either by servlet
or automatically at end of service )
-
authenticate(Request, Response)
- Will extract the user ID from the request, and check the password.
-
authorize(Request, Response)
- Will check if the user is authorized, by checking if it is in one
of the roles defined in security constraints.
-
beforeBody(Request, Response)
- Called before the first body write, and before sending
the headers.
-
beforeCommit(Request, Response)
- Called before the output buffer is commited
-
contextMap(Request)
- Will detect the context path for a request.
-
getMethods()
- Will return the methods fow which this interceptor is interested
in notification.
-
postService(Request, Response)
- Called after service method ends.
-
preService(Request, Response)
- Called before service method is invoked.
-
requestMap(Request)
- Handle mappings inside a context.
OK
public static final int OK
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).
requestMap
public abstract int requestMap(Request request)
- Handle mappings inside a context.
You are required to respect the mappings in web.xml.
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 ?
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.
preService
public abstract int preService(Request request,
Response response)
- Called before service method is invoked.
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.
beforeCommit
public abstract int beforeCommit(Request request,
Response response)
- Called before the output buffer is commited
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 )
postService
public abstract int postService(Request request,
Response response)
- Called after service method ends. Log is a particular use
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