@@ -0,0 +1,1144 @@
+package nl.talsmasoftware.context.servletrequest;%0A%0Aimport javax.servlet.*;%0Aimport java.io.IOException;%0A%0A/**%0A * Servlet %7B@link Filter%7D that registers the current %7B@link ServletRequest%7D with the%0A * %7B@link ServletRequestContextManager%7D to become the%0A * %7B@link ServletRequestContextManager#getActiveContext() active context%7D%0A * while the filter is active.%0A *%0A * @author Sjoerd Talsma%0A */%0Apublic class ServletRequestContextFilter implements Filter %7B%0A%0A    public void init(FilterConfig filterConfig) throws ServletException %7B%0A        // no-op%0A    %7D%0A%0A    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)%0A            throws IOException, ServletException %7B%0A        try %7B%0A            new ServletRequestContext(request); // Automatically becomes the new active context.%0A            chain.doFilter(request, response);%0A        %7D finally %7B%0A            ServletRequestContext.clear(); // Make sure there are no requests returned to the HTTP threadpool.%0A        %7D%0A    %7D%0A%0A    public void destroy() %7B%0A        // no-op%0A    %7D%0A%0A    @Override%0A    public String toString() %7B%0A        return getClass().getSimpleName();%0A    %7D%0A%0A%7D%0A

Add servlet filter: ServletRequestContextFilter.