Top Description Fields Constructors Methods
org.springframework.web.reactive.result.view.script

public Class ScriptTemplateViewResolver

extends UrlBasedViewResolver
Class Inheritance
Imports
org.springframework.web.reactive.result.view.AbstractUrlBasedView, .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 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.

Author
Sebastien Deleuze
Since
5.0
See Also
ScriptTemplateConfigurer

Field Summary

Inherited from org.springframework.web.reactive.result.view.UrlBasedViewResolver:
REDIRECT_URL_PREFIX

Constructor Summary

AccessConstructor and Description
public
public
ScriptTemplateViewResolver(String
the prefix that gets prepended to view names when building a URL
prefix
,
String
the suffix that gets appended to view names when building a URL
suffix
)

A convenience constructor that allows for specifying prefix and suffix as constructor arguments.

Method Summary

Modifier and TypeMethod and Description
protected AbstractUrlBasedView
protected Class<?>
Inherited from org.springframework.web.reactive.result.view.UrlBasedViewResolver:
afterPropertiesSetapplyLifecycleMethodscanHandlecreateViewgetApplicationContextgetPrefixgetRequestContextAttributegetSuffixgetViewClassgetViewNamesresolveViewNamesetApplicationContextsetPrefixsetRedirectViewProvidersetRequestContextAttributesetSuffixsetViewClasssetViewNames

Constructor Detail

ScriptTemplateViewResolverback to summary
public ScriptTemplateViewResolver()

Sets the default view class to requiredViewClass: by default ScriptTemplateView.

ScriptTemplateViewResolverback to summary
public ScriptTemplateViewResolver(String prefix, String suffix)

A convenience constructor that allows for specifying prefix and suffix as constructor arguments.

Parameters
prefix:String

the prefix that gets prepended to view names when building a URL

suffix:String

the suffix that gets appended to view names when building a URL

Method Detail

instantiateViewback to summary
protected AbstractUrlBasedView instantiateView()

Overrides org.springframework.web.reactive.result.view.UrlBasedViewResolver.instantiateView.

Doc from org.springframework.web.reactive.result.view.UrlBasedViewResolver.instantiateView.

Instantiate the specified view class.

The default implementation uses reflection to instantiate the class.

Returns:AbstractUrlBasedView

a new instance of the view class

Annotations
@Override
requiredViewClassback to summary
protected Class<?> requiredViewClass()

Overrides org.springframework.web.reactive.result.view.UrlBasedViewResolver.requiredViewClass.

Doc from org.springframework.web.reactive.result.view.UrlBasedViewResolver.requiredViewClass.

Return the required type of view for this resolver. This implementation returns AbstractUrlBasedView.

Annotations
@Override