Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Null HttpChannel.getCurrentHttpChannel() in ServletHandler.doFilter()

I'm attempting to make SiteMesh3 an asynchronous filter so that it will work with Jetty's asynchronous ProxyServlet.Transparent proxy. Everything appears to work until the SiteMesh filter hands off to Jetty - specifically in ServletHandler.doFilter(). The NullPointerException happens on the first line of that method (line 1628 for jetty-proxy 9.2.1.v20140609). When I debug into it I see that the request is *not* an instance of Request, and HttpChannel.getCurrentHttpChannel() is null, which is why it throws a NPE when trying to call getRequest(). 

My question is this - is there any way for me to initialize or setup HttpChannel, or is that completely outside of what I should be doing when I use the Jetty proxy? Thanks so much for your help. 

        @Override
        public void doFilter(ServletRequest request, ServletResponse response)
            throws IOException, ServletException
        {
            final Request baseRequest=(request instanceof Request)?((Request)request):HttpChannel.getCurrentHttpChannel().getRequest();

Back to the top