Skip to content

Commit 9dcdfec

Browse files
committed
Properly retrieve and expose HttpServletResponse for async requests
Issue: SPR-15867
1 parent 07a0a31 commit 9dcdfec

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

spring-webmvc/src/main/java/org/springframework/web/servlet/FrameworkServlet.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -1133,8 +1133,9 @@ private class RequestBindingInterceptor extends CallableProcessingInterceptorAda
11331133
public <T> void preProcess(NativeWebRequest webRequest, Callable<T> task) {
11341134
HttpServletRequest request = webRequest.getNativeRequest(HttpServletRequest.class);
11351135
if (request != null) {
1136-
HttpServletResponse response = webRequest.getNativeRequest(HttpServletResponse.class);
1137-
initContextHolders(request, buildLocaleContext(request), buildRequestAttributes(request, response, null));
1136+
HttpServletResponse response = webRequest.getNativeResponse(HttpServletResponse.class);
1137+
initContextHolders(request, buildLocaleContext(request),
1138+
buildRequestAttributes(request, response, null));
11381139
}
11391140
}
11401141
@Override

0 commit comments

Comments
 (0)