org.springframework.web.servlet.mvc.method.annotation
Class ViewMethodReturnValueHandler
java.lang.Object
org.springframework.web.servlet.mvc.method.annotation.ViewMethodReturnValueHandler
- All Implemented Interfaces:
- org.springframework.web.method.support.HandlerMethodReturnValueHandler
public class ViewMethodReturnValueHandler
- extends java.lang.Object
- implements org.springframework.web.method.support.HandlerMethodReturnValueHandler
Handles return values that are of type View
.
A null
return value is left as-is leaving it to the configured
RequestToViewNameTranslator
to select a view name by convention.
A View
return type has a set purpose. Therefore this handler
should be configured ahead of handlers that support any return value type
annotated with @ModelAttribute
or @ResponseBody
to ensure
they don't take over.
- Since:
- 3.1
- Author:
- Rossen Stoyanchev
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 webRequest)
|
boolean |
supportsReturnType(org.springframework.core.MethodParameter returnType)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ViewMethodReturnValueHandler
public ViewMethodReturnValueHandler()
supportsReturnType
public boolean supportsReturnType(org.springframework.core.MethodParameter returnType)
- Specified by:
supportsReturnType
in interface org.springframework.web.method.support.HandlerMethodReturnValueHandler
handleReturnValue
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 webRequest)
throws java.lang.Exception
- Specified by:
handleReturnValue
in interface org.springframework.web.method.support.HandlerMethodReturnValueHandler
- Throws:
java.lang.Exception