public interface ModelAndViewResolver
A typical implementation could look like as follows:
public class MyModelAndViewResolver implements ModelAndViewResolver { public ModelAndView resolveModelAndView(Method handlerMethod, Class handlerType, Object returnValue, ExtendedModelMap implicitModel, NativeWebRequest webRequest) { if (returnValue instanceof MySpecialRetVal.class)) { return new MySpecialRetVal(returnValue); } return UNRESOLVED; } }
AnnotationMethodHandlerAdapter.setCustomModelAndViewResolvers(org.springframework.web.servlet.mvc.annotation.ModelAndViewResolver[])
,
AnnotationMethodHandlerAdapter.setCustomModelAndViewResolvers(org.springframework.web.servlet.mvc.annotation.ModelAndViewResolver[])
Modifier and Type | Field and Description |
---|---|
static ModelAndView |
UNRESOLVED
Marker to be returned when the resolver does not know how to handle the given method parameter.
|
Modifier and Type | Method and Description |
---|---|
ModelAndView |
resolveModelAndView(Method handlerMethod,
Class handlerType,
Object returnValue,
ExtendedModelMap implicitModel,
NativeWebRequest webRequest) |
static final ModelAndView UNRESOLVED
ModelAndView resolveModelAndView(Method handlerMethod, Class handlerType, Object returnValue, ExtendedModelMap implicitModel, NativeWebRequest webRequest)