org.springframework.web.servlet.config.annotation

## Class RedirectViewControllerRegistration

- java.lang.Object
- - org.springframework.web.servlet.config.annotation.RedirectViewControllerRegistration

-     public class RedirectViewControllerRegistration
      extends Object

  Assist with the registration of a single redirect view controller.
  Since:
    4.1
  Author:
    Rossen Stoyanchev

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RedirectViewControllerRegistration(String urlPath, String redirectUrl)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected String` | `getUrlPath()`
    `protected ParameterizableViewController` | `getViewController()`
    `protected void` | `setApplicationContext(ApplicationContext applicationContext)`
    `RedirectViewControllerRegistration` | `setContextRelative(boolean contextRelative)` Whether to interpret a given redirect URL that starts with a slash ("/") as relative to the current ServletContext, i.e.
    `RedirectViewControllerRegistration` | `setKeepQueryParams(boolean propagate)` Whether to propagate the query parameters of the current request through to the target redirect URL.
    `RedirectViewControllerRegistration` | `setStatusCode(HttpStatus statusCode)` Set the specific redirect 3xx status code to use.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### RedirectViewControllerRegistration

          public RedirectViewControllerRegistration(String urlPath,
                                                    String redirectUrl)

  - ### Method Detail

    - #### setStatusCode

          public RedirectViewControllerRegistration setStatusCode(HttpStatus statusCode)

      Set the specific redirect 3xx status code to use.

      If not set, `RedirectView` will select `HttpStatus.MOVED_TEMPORARILY (302)` by default.

    - #### setContextRelative

          public RedirectViewControllerRegistration setContextRelative(boolean contextRelative)

      Whether to interpret a given redirect URL that starts with a slash ("/") as relative to the current ServletContext, i.e. as relative to the web application root.

      Default is `true`.

    - #### setKeepQueryParams

          public RedirectViewControllerRegistration setKeepQueryParams(boolean propagate)

      Whether to propagate the query parameters of the current request through to the target redirect URL.

      Default is `false`.

    - #### setApplicationContext

          protected void setApplicationContext(@Nullable
                                               ApplicationContext applicationContext)

    - #### getUrlPath

          protected String getUrlPath()

    - #### getViewController

          protected ParameterizableViewController getViewController()