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; } }
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(java.lang.reflect.Method handlerMethod,
java.lang.Class<?> handlerType,
java.lang.Object returnValue,
ExtendedModelMap implicitModel,
NativeWebRequest webRequest) |
static final ModelAndView UNRESOLVED
ModelAndView resolveModelAndView(java.lang.reflect.Method handlerMethod, java.lang.Class<?> handlerType, @Nullable java.lang.Object returnValue, ExtendedModelMap implicitModel, NativeWebRequest webRequest)