Class ParameterizableViewController

    • Method Detail

      • setViewName

        public void setViewName​(@Nullable
                                String viewName)
        Set a view name for the ModelAndView to return, to be resolved by the DispatcherServlet via a ViewResolver. Will override any pre-existing view name or View.
      • setView

        public void setView​(View view)
        Set a View object for the ModelAndView to return. Will override any pre-existing view name or View.
        Since:
        4.1
      • getView

        @Nullable
        public View getView()
        Return the View object, or null if we are using a view name to be resolved by the DispatcherServlet via a ViewResolver.
        Since:
        4.1
      • setStatusCode

        public void setStatusCode​(@Nullable
                                  HttpStatus statusCode)
        Configure the HTTP status code that this controller should set on the response.

        When a "redirect:" prefixed view name is configured, there is no need to set this property since RedirectView will do that. However this property may still be used to override the 3xx status code of RedirectView. For full control over redirecting provide a RedirectView instance.

        If the status code is 204 and no view is configured, the request is fully handled within the controller.

        Since:
        4.1
      • setStatusOnly

        public void setStatusOnly​(boolean statusOnly)
        The property can be used to indicate the request is considered fully handled within the controller and that no view should be used for rendering. Useful in combination with setStatusCode(org.springframework.http.HttpStatus).

        By default this is set to false.

        Since:
        4.1
      • isStatusOnly

        public boolean isStatusOnly()
        Whether the request is fully handled within the controller.