org.springframework.web.reactive.result.view.script

## Class ScriptTemplateViewResolver

- java.lang.Object
- - org.springframework.web.reactive.result.view.ViewResolverSupport
  - - org.springframework.web.reactive.result.view.UrlBasedViewResolver
    - - org.springframework.web.reactive.result.view.script.ScriptTemplateViewResolver

- All Implemented Interfaces:
    Aware, InitializingBean, ApplicationContextAware, Ordered, ViewResolver

      public class ScriptTemplateViewResolver
      extends UrlBasedViewResolver

  Convenience subclass of `UrlBasedViewResolver` that supports `ScriptTemplateView` and custom subclasses of it.

  The view class for all views created by this resolver can be specified via the `UrlBasedViewResolver.setViewClass(Class)` property.

  Note: When chaining ViewResolvers this resolver will check for the existence of the specified template resources and only return a non-null View object if a template is actually found.

  Since:
    5.0
  Author:
    Sebastien Deleuze
  See Also:
    `ScriptTemplateConfigurer`

- - ### Field Summary

    - ### Fields inherited from class org.springframework.web.reactive.result.view.UrlBasedViewResolver

      `REDIRECT_URL_PREFIX`

    - ### Fields inherited from class org.springframework.web.reactive.result.view.ViewResolverSupport

      `DEFAULT_CONTENT_TYPE`

    - ### Fields inherited from interface org.springframework.core.Ordered

      `HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ScriptTemplateViewResolver()` Sets the default `view class` to `requiredViewClass()`: by default `ScriptTemplateView`.
    `ScriptTemplateViewResolver(String prefix, String suffix)` A convenience constructor that allows for specifying `prefix` and `suffix` as constructor arguments.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected AbstractUrlBasedView` | `instantiateView()` Instantiate the specified view class.
    `protected Class<?>` | `requiredViewClass()` Return the required type of view for this resolver.

    - ### Methods inherited from class org.springframework.web.reactive.result.view.UrlBasedViewResolver

      `afterPropertiesSet, applyLifecycleMethods, canHandle, createView, getApplicationContext, getPrefix, getRequestContextAttribute, getSuffix, getViewClass, getViewNames, resolveViewName, setApplicationContext, setPrefix, setRedirectViewProvider, setRequestContextAttribute, setSuffix, setViewClass, setViewNames`

    - ### Methods inherited from class org.springframework.web.reactive.result.view.ViewResolverSupport

      `getDefaultCharset, getOrder, getSupportedMediaTypes, setDefaultCharset, setOrder, setSupportedMediaTypes`

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

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

- - ### Constructor Detail

    - #### ScriptTemplateViewResolver

          public ScriptTemplateViewResolver()

      Sets the default `view class` to `requiredViewClass()`: by default `ScriptTemplateView`.

    - #### ScriptTemplateViewResolver

          public ScriptTemplateViewResolver(String prefix,
                                            String suffix)

      A convenience constructor that allows for specifying `prefix` and `suffix` as constructor arguments.
      Parameters:
        `prefix` - the prefix that gets prepended to view names when building a URL
        `suffix` - the suffix that gets appended to view names when building a URL

  - ### Method Detail

    - #### requiredViewClass

          protected Class<?> requiredViewClass()

      Description copied from class: `UrlBasedViewResolver`
      Return the required type of view for this resolver. This implementation returns `AbstractUrlBasedView`.
      Overrides:
        `requiredViewClass` in class `UrlBasedViewResolver`
      See Also:
        `UrlBasedViewResolver.instantiateView()`, `AbstractUrlBasedView`

    - #### instantiateView

          protected AbstractUrlBasedView instantiateView()

      Description copied from class: `UrlBasedViewResolver`
      Instantiate the specified view class.

      The default implementation uses reflection to instantiate the class.

      Overrides:
        `instantiateView` in class `UrlBasedViewResolver`
      Returns:
        a new instance of the view class
      See Also:
        `UrlBasedViewResolver.setViewClass(java.lang.Class<?>)`