# Uses of Class
org.springframework.web.servlet.ModelAndView

Packages that use ModelAndView
Package
Description
org.springframework.web.servlet
Provides servlets that integrate with the application context infrastructure, and the core interfaces and classes for the Spring web MVC framework.
org.springframework.web.servlet.function
Provides the types that make up Spring's functional web framework for Servlet environments.
org.springframework.web.servlet.function.support
Classes supporting the `org.springframework.web.servlet.function` package.
org.springframework.web.servlet.handler
Provides standard HandlerMapping implementations, including abstract base classes for custom implementations.
org.springframework.web.servlet.mvc
Standard controller implementations for the Servlet MVC framework that comes with Spring.
org.springframework.web.servlet.mvc.annotation
Support package for annotation-based Servlet MVC controllers.
org.springframework.web.servlet.mvc.method
Servlet-based infrastructure for handler method processing, building on the `org.springframework.web.method` package.
org.springframework.web.servlet.mvc.method.annotation
MVC infrastructure for annotation-based handler method processing, building on the `org.springframework.web.method.annotation` package.
org.springframework.web.servlet.mvc.support
Support package for MVC controllers.
org.springframework.web.servlet.view
Provides standard View and ViewResolver implementations, including abstract base classes for custom implementations.

## Uses of ModelAndView in org.springframework.web.servlet

Methods in org.springframework.web.servlet that return ModelAndView
Modifier and Type
Method
Description
`ModelAndView`
ModelAndView.`addAllObjects(Map<String,?> modelMap)`
Add all attributes contained in the provided Map to the model.
`ModelAndView`
ModelAndView.`addObject(Object attributeValue)`
Add an attribute to the model using parameter name generation.
`ModelAndView`
ModelAndView.`addObject(String attributeName, Object attributeValue)`
Add an attribute to the model.
`ModelAndView`
ModelAndViewDefiningException.`getModelAndView()`
Return the ModelAndView that this exception contains for forwarding to.
`ModelAndView`
HandlerAdapter.`handle(HttpServletRequest request, HttpServletResponse response, Object handler)`
Use the given handler to handle this request.
`protected ModelAndView`
DispatcherServlet.`processHandlerException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)`
Determine an error ModelAndView via the registered HandlerExceptionResolvers.
`ModelAndView`
HandlerExceptionResolver.`resolveException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)`
Try to resolve the given exception that got thrown during handler execution, returning a `ModelAndView` that represents a specific error page if appropriate.
Methods in org.springframework.web.servlet with parameters of type ModelAndView
Modifier and Type
Method
Description
`default void`
HandlerInterceptor.`postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView)`
Interception point after successful execution of a handler.
`protected void`
DispatcherServlet.`render(ModelAndView mv, HttpServletRequest request, HttpServletResponse response)`
Render the given ModelAndView.
Constructors in org.springframework.web.servlet with parameters of type ModelAndView
Modifier
Constructor
Description
``
`ModelAndViewDefiningException(ModelAndView modelAndView)`
Create new ModelAndViewDefiningException with the given ModelAndView, typically representing a specific error page.

## Uses of ModelAndView in org.springframework.web.servlet.function

Methods in org.springframework.web.servlet.function that return ModelAndView
Modifier and Type
Method
Description
`ModelAndView`
ServerResponse.HeadersBuilder.WriteFunction.`write(HttpServletRequest servletRequest, HttpServletResponse servletResponse)`
Write to the given `servletResponse`, or return a `ModelAndView` to be rendered.
`ModelAndView`
ServerResponse.`writeTo(HttpServletRequest request, HttpServletResponse response, ServerResponse.Context context)`
Write this response to the given servlet response.

## Uses of ModelAndView in org.springframework.web.servlet.function.support

Methods in org.springframework.web.servlet.function.support that return ModelAndView
Modifier and Type
Method
Description
`ModelAndView`
HandlerFunctionAdapter.`handle(HttpServletRequest servletRequest, HttpServletResponse servletResponse, Object handler)`

## Uses of ModelAndView in org.springframework.web.servlet.handler

Methods in org.springframework.web.servlet.handler that return ModelAndView
Modifier and Type
Method
Description
`protected abstract ModelAndView`
AbstractHandlerExceptionResolver.`doResolveException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)`
Actually resolve the given exception that got thrown during handler execution, returning a `ModelAndView` that represents a specific error page if appropriate.
`protected final ModelAndView`
AbstractHandlerMethodExceptionResolver.`doResolveException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)`
`protected ModelAndView`
SimpleMappingExceptionResolver.`doResolveException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)`
Actually resolve the given exception that got thrown during on handler execution, returning a ModelAndView that represents a specific error page if appropriate.
`protected abstract ModelAndView`
AbstractHandlerMethodExceptionResolver.`doResolveHandlerMethodException(HttpServletRequest request, HttpServletResponse response, org.springframework.web.method.HandlerMethod handlerMethod, Exception ex)`
Actually resolve the given exception that got thrown during on handler execution, returning a ModelAndView that represents a specific error page if appropriate.
`protected ModelAndView`
SimpleMappingExceptionResolver.`getModelAndView(String viewName, Exception ex)`
Return a ModelAndView for the given view name and exception.
`protected ModelAndView`
SimpleMappingExceptionResolver.`getModelAndView(String viewName, Exception ex, HttpServletRequest request)`
Return a ModelAndView for the given request, view name and exception.
`ModelAndView`
SimpleServletHandlerAdapter.`handle(HttpServletRequest request, HttpServletResponse response, Object handler)`
`ModelAndView`
AbstractHandlerExceptionResolver.`resolveException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)`
Check whether this resolver is supposed to apply (i.e.
`ModelAndView`
HandlerExceptionResolverComposite.`resolveException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)`
Resolve the exception by iterating over the list of configured exception resolvers.
Methods in org.springframework.web.servlet.handler with parameters of type ModelAndView
Modifier and Type
Method
Description
`void`
MappedInterceptor.`postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView)`
`void`
WebRequestHandlerInterceptorAdapter.`postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView)`

## Uses of ModelAndView in org.springframework.web.servlet.mvc

Methods in org.springframework.web.servlet.mvc that return ModelAndView
Modifier and Type
Method
Description
`ModelAndView`
HttpRequestHandlerAdapter.`handle(HttpServletRequest request, HttpServletResponse response, Object handler)`
`ModelAndView`
SimpleControllerHandlerAdapter.`handle(HttpServletRequest request, HttpServletResponse response, Object handler)`
`ModelAndView`
AbstractController.`handleRequest(HttpServletRequest request, HttpServletResponse response)`
`ModelAndView`
Controller.`handleRequest(HttpServletRequest request, HttpServletResponse response)`
Process the request and return a ModelAndView object which the DispatcherServlet will render.
`protected abstract ModelAndView`
AbstractController.`handleRequestInternal(HttpServletRequest request, HttpServletResponse response)`
Template method.
`protected ModelAndView`
AbstractUrlViewController.`handleRequestInternal(HttpServletRequest request, HttpServletResponse response)`
Retrieves the URL path to use for lookup and delegates to `AbstractUrlViewController.getViewNameForRequest(jakarta.servlet.http.HttpServletRequest)`.
`protected ModelAndView`
ParameterizableViewController.`handleRequestInternal(HttpServletRequest request, HttpServletResponse response)`
Return a ModelAndView object with the specified view name.
`protected ModelAndView`
ServletForwardingController.`handleRequestInternal(HttpServletRequest request, HttpServletResponse response)`
`protected ModelAndView`
ServletWrappingController.`handleRequestInternal(HttpServletRequest request, HttpServletResponse response)`
Invoke the wrapped Servlet instance.
Methods in org.springframework.web.servlet.mvc with parameters of type ModelAndView
Modifier and Type
Method
Description
`void`
WebContentInterceptor.`postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView)`
This implementation is empty.

## Uses of ModelAndView in org.springframework.web.servlet.mvc.annotation

Fields in org.springframework.web.servlet.mvc.annotation declared as ModelAndView
Modifier and Type
Field
Description
`static final ModelAndView`
ModelAndViewResolver.`UNRESOLVED`
Marker to be returned when the resolver does not know how to handle the given method parameter.
Methods in org.springframework.web.servlet.mvc.annotation that return ModelAndView
Modifier and Type
Method
Description
`protected ModelAndView`
ResponseStatusExceptionResolver.`applyStatusAndReason(int statusCode, String reason, HttpServletResponse response)`
Apply the resolved status code and reason to the response.
`protected ModelAndView`
ResponseStatusExceptionResolver.`doResolveException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)`
`ModelAndView`
ModelAndViewResolver.`resolveModelAndView(Method handlerMethod, Class<?> handlerType, Object returnValue, org.springframework.ui.ExtendedModelMap implicitModel, org.springframework.web.context.request.NativeWebRequest webRequest)`
`protected ModelAndView`
ResponseStatusExceptionResolver.`resolveResponseStatus(org.springframework.web.bind.annotation.ResponseStatus responseStatus, HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)`
Template method that handles the `@ResponseStatus` annotation.
`protected ModelAndView`
ResponseStatusExceptionResolver.`resolveResponseStatusException(org.springframework.web.server.ResponseStatusException ex, HttpServletRequest request, HttpServletResponse response, Object handler)`
Template method that handles an `ResponseStatusException`.

## Uses of ModelAndView in org.springframework.web.servlet.mvc.method

Methods in org.springframework.web.servlet.mvc.method that return ModelAndView
Modifier and Type
Method
Description
`final ModelAndView`
AbstractHandlerMethodAdapter.`handle(HttpServletRequest request, HttpServletResponse response, Object handler)`
This implementation expects the handler to be an `HandlerMethod`.
`protected abstract ModelAndView`
AbstractHandlerMethodAdapter.`handleInternal(HttpServletRequest request, HttpServletResponse response, org.springframework.web.method.HandlerMethod handlerMethod)`
Use the given handler method to handle the request.

## Uses of ModelAndView in org.springframework.web.servlet.mvc.method.annotation

Methods in org.springframework.web.servlet.mvc.method.annotation that return ModelAndView
Modifier and Type
Method
Description
`protected ModelAndView`
ExceptionHandlerExceptionResolver.`doResolveHandlerMethodException(HttpServletRequest request, HttpServletResponse response, org.springframework.web.method.HandlerMethod handlerMethod, Exception exception)`
Find an `@ExceptionHandler` method and invoke it to handle the raised exception.
`protected ModelAndView`
RequestMappingHandlerAdapter.`handleInternal(HttpServletRequest request, HttpServletResponse response, org.springframework.web.method.HandlerMethod handlerMethod)`
`protected ModelAndView`
RequestMappingHandlerAdapter.`invokeHandlerMethod(HttpServletRequest request, HttpServletResponse response, org.springframework.web.method.HandlerMethod handlerMethod)`
Invoke the `RequestMapping` handler method preparing a `ModelAndView` if view resolution is required.

## Uses of ModelAndView in org.springframework.web.servlet.mvc.support

Methods in org.springframework.web.servlet.mvc.support that return ModelAndView
Modifier and Type
Method
Description
`protected ModelAndView`
DefaultHandlerExceptionResolver.`doResolveException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)`
`protected ModelAndView`
DefaultHandlerExceptionResolver.`handleAsyncRequestNotUsableException(org.springframework.web.context.request.async.AsyncRequestNotUsableException ex, HttpServletRequest request, HttpServletResponse response, Object handler)`
Handle the case of an I/O failure from the ServletOutputStream.
`protected ModelAndView`
DefaultHandlerExceptionResolver.`handleAsyncRequestTimeoutException(org.springframework.web.context.request.async.AsyncRequestTimeoutException ex, HttpServletRequest request, HttpServletResponse response, Object handler)`
Handle the case where an async request timed out.
`protected ModelAndView`
DefaultHandlerExceptionResolver.`handleConversionNotSupported(org.springframework.beans.ConversionNotSupportedException ex, HttpServletRequest request, HttpServletResponse response, Object handler)`
Handle the case when a `WebDataBinder` conversion cannot occur.
`protected ModelAndView`
DefaultHandlerExceptionResolver.`handleDisconnectedClientException(Exception ex, HttpServletRequest request, HttpServletResponse response, Object handler)`
Handle an Exception that indicates the client has gone away.
`protected ModelAndView`
DefaultHandlerExceptionResolver.`handleErrorResponse(org.springframework.web.ErrorResponse errorResponse, HttpServletRequest request, HttpServletResponse response, Object handler)`
Handle an `ErrorResponse` exception.
`protected ModelAndView`
DefaultHandlerExceptionResolver.`handleHandlerMethodValidationException(org.springframework.web.method.annotation.HandlerMethodValidationException ex, HttpServletRequest request, HttpServletResponse response, Object handler)`
Handle the case where method validation for a controller method failed.
`protected ModelAndView`
DefaultHandlerExceptionResolver.`handleHttpMediaTypeNotAcceptable(org.springframework.web.HttpMediaTypeNotAcceptableException ex, HttpServletRequest request, HttpServletResponse response, Object handler)`
Handle the case where no message converters were found that were acceptable for the client (expressed via the `Accept` header).
`protected ModelAndView`
DefaultHandlerExceptionResolver.`handleHttpMediaTypeNotSupported(org.springframework.web.HttpMediaTypeNotSupportedException ex, HttpServletRequest request, HttpServletResponse response, Object handler)`
Handle the case where no message converters were found for PUT or POSTed content.
`protected ModelAndView`
DefaultHandlerExceptionResolver.`handleHttpMessageNotReadable(org.springframework.http.converter.HttpMessageNotReadableException ex, HttpServletRequest request, HttpServletResponse response, Object handler)`
Handle the case where a message converter cannot read from an HTTP request.
`protected ModelAndView`
DefaultHandlerExceptionResolver.`handleHttpMessageNotWritable(org.springframework.http.converter.HttpMessageNotWritableException ex, HttpServletRequest request, HttpServletResponse response, Object handler)`
Handle the case where a message converter cannot write to an HTTP response.
`protected ModelAndView`
DefaultHandlerExceptionResolver.`handleHttpRequestMethodNotSupported(org.springframework.web.HttpRequestMethodNotSupportedException ex, HttpServletRequest request, HttpServletResponse response, Object handler)`
Handle the case where no handler was found for the HTTP method.
`protected ModelAndView`
DefaultHandlerExceptionResolver.`handleMethodArgumentNotValidException(org.springframework.web.bind.MethodArgumentNotValidException ex, HttpServletRequest request, HttpServletResponse response, Object handler)`
Handle the case where an argument annotated with `@Valid` such as an `RequestBody` or `RequestPart` argument fails validation.
`protected ModelAndView`
DefaultHandlerExceptionResolver.`handleMethodValidationException(org.springframework.validation.method.MethodValidationException ex, HttpServletRequest request, HttpServletResponse response, Object handler)`
Handle the case where method validation failed on a component that is not a web controller, for example, on some underlying service.
`protected ModelAndView`
DefaultHandlerExceptionResolver.`handleMissingPathVariable(org.springframework.web.bind.MissingPathVariableException ex, HttpServletRequest request, HttpServletResponse response, Object handler)`
Handle the case when a declared path variable does not match any extracted URI variable.
`protected ModelAndView`
DefaultHandlerExceptionResolver.`handleMissingServletRequestParameter(org.springframework.web.bind.MissingServletRequestParameterException ex, HttpServletRequest request, HttpServletResponse response, Object handler)`
Handle the case when a required parameter is missing.
`protected ModelAndView`
DefaultHandlerExceptionResolver.`handleMissingServletRequestPartException(org.springframework.web.multipart.support.MissingServletRequestPartException ex, HttpServletRequest request, HttpServletResponse response, Object handler)`
Handle the case where an @RequestPart, a `MultipartFile`, or a `jakarta.servlet.http.Part` argument is required but is missing.
`protected ModelAndView`
DefaultHandlerExceptionResolver.`handleNoHandlerFoundException(NoHandlerFoundException ex, HttpServletRequest request, HttpServletResponse response, Object handler)`
Handle the case where no handler was found during the dispatch.
`protected ModelAndView`
DefaultHandlerExceptionResolver.`handleNoResourceFoundException(NoResourceFoundException ex, HttpServletRequest request, HttpServletResponse response, Object handler)`
Handle the case where no static resource was found.
`protected ModelAndView`
DefaultHandlerExceptionResolver.`handleServletRequestBindingException(org.springframework.web.bind.ServletRequestBindingException ex, HttpServletRequest request, HttpServletResponse response, Object handler)`
Handle the case when an unrecoverable binding exception occurs - for example, required header, required cookie.
`protected ModelAndView`
DefaultHandlerExceptionResolver.`handleTypeMismatch(org.springframework.beans.TypeMismatchException ex, HttpServletRequest request, HttpServletResponse response, Object handler)`
Handle the case when a `WebDataBinder` conversion error occurs.

## Uses of ModelAndView in org.springframework.web.servlet.view

Methods in org.springframework.web.servlet.view with parameters of type ModelAndView
Modifier and Type
Method
Description
`FragmentsRendering.Builder`
FragmentsRendering.Builder.`fragment(ModelAndView fragment)`
Variant of `FragmentsRendering.Builder.fragment(String, Map)` with a `ModelAndView`.
Method parameters in org.springframework.web.servlet.view with type arguments of type ModelAndView
Modifier and Type
Method
Description
`FragmentsRendering.Builder`
FragmentsRendering.Builder.`fragments(Collection<ModelAndView> fragments)`
Variant of `FragmentsRendering.Builder.fragment(String, Map)` with a collection of `ModelAndView`s.
`static FragmentsRendering.Builder`
FragmentsRendering.`with(Collection<ModelAndView> fragments)`
Variant of `FragmentsRendering.with(String, Map)` with a collection of fragments.