Module io.jooby
Package io.jooby

Class MapModelAndView


public class MapModelAndView extends ModelAndView<Map<String,Object>>
  • Constructor Details

    • MapModelAndView

      public MapModelAndView(@NonNull String view, @NonNull Map<String,Object> model)
      Creates a new model and view.
      Parameters:
      view - View name must include file extension.
      model - View model.
    • MapModelAndView

      public MapModelAndView(@NonNull String view)
      Creates a new model and view.
      Parameters:
      view - View name must include file extension.
  • Method Details

    • put

      public MapModelAndView put(@NonNull String name, Object value)
      Put a model attribute.
      Parameters:
      name - Name.
      value - Value.
      Returns:
      This model and view.
    • put

      public MapModelAndView put(@NonNull Map<String,Object> attributes)
      Copy all the attributes into the model.
      Parameters:
      attributes - Attributes.
      Returns:
      This model and view.
    • setLocale

      public MapModelAndView setLocale(@Nullable Locale locale)
      Description copied from class: ModelAndView
      Sets the locale used when rendering the view, if the template engine supports setting it. Specifying null triggers a fallback to a locale determined by the current request.
      Overrides:
      setLocale in class ModelAndView<Map<String,Object>>
      Parameters:
      locale - The locale used when rendering the view.
      Returns:
      This instance.