Class ModelAndView

java.lang.Object
spark.ModelAndView

public class ModelAndView extends Object
Model And View class is used to set the name of the view and the model object to be rendered.
  • Field Details

    • model

      private Object model
      Model object.
    • viewName

      private String viewName
      View name used to render output.
  • Constructor Details

    • ModelAndView

      public ModelAndView(Object model, String viewName)
      Constructs an instance with the provided model and view name
      Parameters:
      model - the model
      viewName - the view name
  • Method Details

    • getModel

      public Object getModel()
      Returns:
      the model object
    • getViewName

      public String getViewName()
      Returns:
      the view name