Use the type of the actual return value in @MVC

The new @MVC support classes select a HandlerMethodArgumentResolver
and a HandlerMethodReturnValueHandler statically, i.e. based on
the signature of the method, which means that a controller method
can't declare a more general return type like Object but actually
return a more specific one, e.g.  String vs RedirectView, and
expect the right handler to be used.

The fix ensures that a HandlerMethodReturnValueHandler is selected
based on the actual return value type, which is something that was
supported with the old @MVC support classes. One consequence
of the change is the selected HandlerMethodReturnValueHandler can
no longer be cached but that matches the behavior of the old
@MVC support classes.

Issues: SPR-9218
This commit is contained in:
Rossen Stoyanchev
2012-04-06 16:37:07 -04:00
parent 97c22fc08e
commit cfe2af7690
6 changed files with 104 additions and 70 deletions

View File

@@ -5,8 +5,11 @@ http://www.springsource.org
Changes in version 3.2 M1
-------------------------------------
* fix issue with parsing invalid Content-Type or Accept headers
* better handling on failure to parse invalid 'Content-Type' or 'Accept' headers
* handle a controller method's return value based on the actual returned value (vs declared type)
* fix issue with combining identical controller and method level request mapping paths
* fix concurrency issue in AnnotationMethodHandlerExceptionResolver
* fix case-sensitivity issue with some containers on access to 'Content-Disposition' header
Changes in version 3.1.1 (2012-02-16)
-------------------------------------