FilterHandler.java 文件源码

java
阅读 40 收藏 0 点赞 0 评论 0

项目:lams 作者:
@Override
public void handleRequest(final HttpServerExchange exchange) throws Exception {
    final ServletRequestContext servletRequestContext = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY);
    ServletRequest request = servletRequestContext.getServletRequest();
    ServletResponse response = servletRequestContext.getServletResponse();
    DispatcherType dispatcher = servletRequestContext.getDispatcherType();
    Boolean supported = asyncSupported.get(dispatcher);
    if(supported != null && ! supported) {
        exchange.putAttachment(AsyncContextImpl.ASYNC_SUPPORTED, false    );
    }

    final List<ManagedFilter> filters = this.filters.get(dispatcher);
    if(filters == null) {
        next.handleRequest(exchange);
    } else {
        final FilterChainImpl filterChain = new FilterChainImpl(exchange, filters, next, allowNonStandardWrappers);
        filterChain.doFilter(request, response);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号