You could contribute a HttpServletRequestFilter to the HttpServletRequestHandler or you could contribute a RequestFilter to the RequestHandler. The preferred approach is a RequestFilter.
Make sure you order your filter contribution before:*
so that it executes before the rest of the request processing
eg MyAppModule.java
public static void contributeRequestHandler(OrderedConfiguration<RequestFilter> config) {
config.addInstance(MyRequestFilter.class, "before:*");
}