/** * Dispatches client requests to the {@link #doFilter(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.FilterChain) } * method. * * @param request the {@link HttpServletRequest} object that * contains the request the client made to * the servlet. * @param response the {@link HttpServletResponse} object that * contains the response the servlet returns * to the client. * @param chain the chain of filters from which the next filter can be invoked. * @throws java.io.IOException * @throws javax.servlet.ServletException */ public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { try { doFilter((HttpServletRequest)request, (HttpServletResponse)response, chain); } catch (ClassCastException e) { throw new ServletException("non-HTTP request or response"); } }
/** * Dispatches client requests to the {@link #doFilter(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.FilterChain) } * method. * * @param request the {@link HttpServletRequest} object that * contains the request the client made to * the servlet. * @param response the {@link HttpServletResponse} object that * contains the response the servlet returns * to the client. * @param chain the chain of filters from which the next filter can be invoked. * @throws java.io.IOException * @throws javax.servlet.ServletException */ public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { try { doFilter((HttpServletRequest)request, (HttpServletResponse)response, chain); } catch (ClassCastException e) { throw new ServletException("non-HTTP request or response"); } }
/** * Dispatches client requests to the {@link #doFilter(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.FilterChain) } * method. * * @param request the {@link HttpServletRequest} object that * contains the request the client made to * the servlet. * @param response the {@link HttpServletResponse} object that * contains the response the servlet returns * to the client. * @param chain the chain of filters from which the next filter can be invoked. * @throws java.io.IOException * @throws javax.servlet.ServletException */ public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { try { doFilter((HttpServletRequest)request, (HttpServletResponse)response, chain); } catch (ClassCastException e) { throw new ServletException("non-HTTP request or response"); } }
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { ClassLoader currentThreadClassLoader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(chainingClassLoader); try { servletContainer.doFilter(request, response, chain); } finally { Thread.currentThread().setContextClassLoader(currentThreadClassLoader); } }