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 |
|---|---|
| public static final 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 |
|---|---|
| public ModelAndView | resolveModelAndView(Method handlerMethod, Class<?> handlerType, Object returnValue, ExtendedModelMap implicitModel, NativeWebRequest webRequest)
|
| UNRESOLVED | back to summary |
|---|---|
| public static final ModelAndView UNRESOLVED Marker to be returned when the resolver does not know how to handle the given method parameter. | |
| resolveModelAndView | back to summary |
|---|---|
| public ModelAndView resolveModelAndView(Method handlerMethod, Class<?> handlerType, Object returnValue, ExtendedModelMap implicitModel, NativeWebRequest webRequest) | |