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[]),
org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter#setCustomModelAndViewResolvers| 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,
org.springframework.ui.ExtendedModelMap implicitModel,
org.springframework.web.context.request.NativeWebRequest webRequest) |
static final ModelAndView UNRESOLVED
ModelAndView resolveModelAndView(Method handlerMethod, Class<?> handlerType, Object returnValue, org.springframework.ui.ExtendedModelMap implicitModel, org.springframework.web.context.request.NativeWebRequest webRequest)