|
spring-webmvc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.web.servlet.mvc.method.annotation.ModelAndViewResolverMethodReturnValueHandler
public class ModelAndViewResolverMethodReturnValueHandler
This return value handler is intended to be ordered after all others as it
attempts to handle _any_ return value type (i.e. returns true
for
all return types).
The return value is handled either with a ModelAndViewResolver
or otherwise by regarding it as a model attribute if it is a non-simple
type. If neither of these succeeds (essentially simple type other than
String), UnsupportedOperationException
is raised.
Note: This class is primarily needed to support
ModelAndViewResolver
, which unfortunately cannot be properly
adapted to the HandlerMethodReturnValueHandler
contract since the
HandlerMethodReturnValueHandler.supportsReturnType(org.springframework.core.MethodParameter)
method
cannot be implemented. Hence ModelAndViewResolver
s are limited
to always being invoked at the end after all other return value
handlers have been given a chance. It is recommended to re-implement
a ModelAndViewResolver
as HandlerMethodReturnValueHandler
,
which also provides better access to the return type and method information.
Constructor Summary | |
---|---|
ModelAndViewResolverMethodReturnValueHandler(java.util.List<ModelAndViewResolver> mavResolvers)
Create a new instance. |
Method Summary | |
---|---|
void |
handleReturnValue(java.lang.Object returnValue,
org.springframework.core.MethodParameter returnType,
org.springframework.web.method.support.ModelAndViewContainer mavContainer,
org.springframework.web.context.request.NativeWebRequest request)
|
boolean |
supportsReturnType(org.springframework.core.MethodParameter returnType)
Always returns true . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ModelAndViewResolverMethodReturnValueHandler(java.util.List<ModelAndViewResolver> mavResolvers)
Method Detail |
---|
public boolean supportsReturnType(org.springframework.core.MethodParameter returnType)
true
. See class-level note.
supportsReturnType
in interface org.springframework.web.method.support.HandlerMethodReturnValueHandler
public void handleReturnValue(java.lang.Object returnValue, org.springframework.core.MethodParameter returnType, org.springframework.web.method.support.ModelAndViewContainer mavContainer, org.springframework.web.context.request.NativeWebRequest request) throws java.lang.Exception
handleReturnValue
in interface org.springframework.web.method.support.HandlerMethodReturnValueHandler
java.lang.Exception
|
spring-webmvc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |