diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerAdapter.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerAdapter.java index 9e84d356d95..cf5c5fce246 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerAdapter.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerAdapter.java @@ -721,7 +721,7 @@ public class RequestMappingHandlerAdapter extends AbstractHandlerMethodAdapter protected ModelAndView handleInternal(HttpServletRequest request, HttpServletResponse response, HandlerMethod handlerMethod) throws Exception { - ModelAndView mav = null; + ModelAndView mav; checkRequest(request); // Execute invokeHandlerMethod in synchronized block if required. @@ -733,8 +733,13 @@ public class RequestMappingHandlerAdapter extends AbstractHandlerMethodAdapter mav = invokeHandlerMethod(request, response, handlerMethod); } } + else { + // No HttpSession available -> no mutex necessary + mav = invokeHandlerMethod(request, response, handlerMethod); + } } else { + // No synchronization on session demanded at all... mav = invokeHandlerMethod(request, response, handlerMethod); }