2016-03-21 7 views
2

を実行すると、それは二回invokeHandlerMethod【選択コードを呼び出す明らかで二度コントローラを呼び出すSpringMVC4.2.5:私は「でき なぜ私は、HTTPリクエストがちょうどその時、関数deal <code>RequestMappingHandlerAdapter.handleInternal</code>をonce.But送ることを確信していますRequestMappingHandlerAdapter

@Override 
protected ModelAndView handleInternal(HttpServletRequest request, 
     HttpServletResponse response, HandlerMethod handlerMethod) throws Exception { 

    ModelAndView mav = null; 
    checkRequest(request); 

    // Execute invokeHandlerMethod in synchronized block if required. 
    if (this.synchronizeOnSession) { 
     HttpSession session = request.getSession(false); 
     if (session != null) { 
      Object mutex = WebUtils.getSessionMutex(session); 
      synchronized (mutex) { 
       mav = invokeHandlerMethod(request, response, handlerMethod); 
      } 
     } 
    } 

    mav = invokeHandlerMethod(request, response, handlerMethod); 

    if (getSessionAttributesHandler(handlerMethod).hasSessionAttributes()) { 
     applyCacheSeconds(response, this.cacheSecondsForSessionAttributeHandlers); 
    } 
    else { 
     prepareResponse(response); 
    } 

    return mav; 
} 

をなぜここでinvokeHandlerMethod(request, response, handlerMethod)を呼び出すのか理解していません。​​は、とにかく2番目の呼び出しの結果でなければなりません。

+0

私はバージョン4.2.4とそのバージョンを前に読みましたが、このプロセスを使用していません。これはspringwebmvcのバグだろうと思います... – Copperfield

答えて

関連する問題

 関連する問題