Top Description Fields Constructors Methods
org.springframework.web.servlet

public Class ModelAndViewDefiningException

extends ServletException
Class Inheritance
Annotations
@SuppressWarnings:serial
Imports
jakarta.servlet.ServletException, org.springframework.util.Assert

Exception to be thrown on error conditions that should forward to a specific view with a specific model.

Can be thrown at any time during handler processing. This includes any template methods of pre-built controllers. For example, a form controller might abort to a specific error page if certain parameters do not allow to proceed with the normal workflow.

Author
Juergen Hoeller
Since
22.11.2003

Field Summary

Modifier and TypeField and Description
private final ModelAndView

Constructor Summary

AccessConstructor and Description
public
ModelAndViewDefiningException(ModelAndView
the ModelAndView with view to forward to and model to expose
modelAndView
)

Create new ModelAndViewDefiningException with the given ModelAndView, typically representing a specific error page.

Method Summary

Modifier and TypeMethod and Description
public ModelAndView
getModelAndView()

Return the ModelAndView that this exception contains for forwarding to.

Inherited from jakarta.servlet.ServletException:
getRootCause

Field Detail

modelAndViewback to summary
private final ModelAndView modelAndView

Constructor Detail

ModelAndViewDefiningExceptionback to summary
public ModelAndViewDefiningException(ModelAndView modelAndView)

Create new ModelAndViewDefiningException with the given ModelAndView, typically representing a specific error page.

Parameters
modelAndView:ModelAndView

the ModelAndView with view to forward to and model to expose

Method Detail

getModelAndViewback to summary
public ModelAndView getModelAndView()

Return the ModelAndView that this exception contains for forwarding to.