Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 弹簧&x27;当我使用异步servlet(Spring3.2)时,s ETag过滤器无效_Java_Spring_Servlet 3.0_Etag - Fatal编程技术网

Java 弹簧&x27;当我使用异步servlet(Spring3.2)时,s ETag过滤器无效

Java 弹簧&x27;当我使用异步servlet(Spring3.2)时,s ETag过滤器无效,java,spring,servlet-3.0,etag,Java,Spring,Servlet 3.0,Etag,最近,我们在servlet 3.0和spring 3.2中使用了异步功能,但是我们的ShallowEtagHeaderFilter根本没有效果,我想一定是框架在处理我的内容之前刷新了响应。。。 如何解决?有人有经验吗?参考Spring 4.3.5中ShallowEtagFilter的代码片段 protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain f

最近,我们在servlet 3.0和spring 3.2中使用了异步功能,但是我们的ShallowEtagHeaderFilter根本没有效果,我想一定是框架在处理我的内容之前刷新了响应。。。
如何解决?有人有经验吗?

参考Spring 4.3.5中ShallowEtagFilter的代码片段

protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
        throws ServletException, IOException {

    HttpServletResponse responseToUse = response;
    if (!isAsyncDispatch(request) && !(response instanceof ContentCachingResponseWrapper)) {
        responseToUse = new HttpStreamingAwareContentCachingResponseWrapper(response, request);
    }

    filterChain.doFilter(request, responseToUse);

    if (!isAsyncStarted(request) && !isContentCachingDisabled(request)) {
        updateResponse(request, responseToUse);
    }
}

/**
     * Whether request processing is in asynchronous mode meaning that the
     * response will not be committed after the current thread is exited.
     * @param request the current request
     * @since 3.2
     * @see WebAsyncManager#isConcurrentHandlingStarted()
     */
    protected boolean isAsyncStarted(HttpServletRequest request) {
        return WebAsyncUtils.getAsyncManager(request).isConcurrentHandlingStarted();
    }
当您使用AsyncServlet时,将不满足该条件,这意味着不会调用生成etag的业务逻辑