Top Description Fields Constructors Methods
org.springframework.web.servlet.view.script

public Class RenderingContext

extends Object
Class Inheritance
Imports
java.util.Locale, java.util.function.Function, org.springframework.context.ApplicationContext

Context passed to ScriptTemplateView render function in order to make the application context, the locale, the template loader and the url available on scripting side.
Author
Sebastien Deleuze
Since
5.0

Field Summary

Modifier and TypeField and Description
private final ApplicationContext
private final Locale
private final Function<String, String>
private final String

Constructor Summary

AccessConstructor and Description
public
RenderingContext(ApplicationContext
the application context
applicationContext
,
Locale
the locale of the rendered template
locale
,
Function<String, String>
a function that takes a template path as input and returns the template content as a String
templateLoader
,
String
the URL of the rendered template
url
)

Create a new RenderingContext.

Method Summary

Modifier and TypeMethod and Description
public ApplicationContext
getApplicationContext()

Return the application context.

public Locale
getLocale()

Return the locale of the rendered template.

public Function<String, String>
getTemplateLoader()

Return a function that takes a template path as input and returns the template content as a String.

public String
getUrl()

Return the URL of the rendered template.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

applicationContextback to summary
private final ApplicationContext applicationContext
localeback to summary
private final Locale locale
templateLoaderback to summary
private final Function<String, String> templateLoader
urlback to summary
private final String url

Constructor Detail

RenderingContextback to summary
public RenderingContext(ApplicationContext applicationContext, Locale locale, Function<String, String> templateLoader, String url)

Create a new RenderingContext.

Parameters
applicationContext:ApplicationContext

the application context

locale:Locale

the locale of the rendered template

templateLoader:Function<String, String>

a function that takes a template path as input and returns the template content as a String

url:String

the URL of the rendered template

Method Detail

getApplicationContextback to summary
public ApplicationContext getApplicationContext()

Return the application context.

getLocaleback to summary
public Locale getLocale()

Return the locale of the rendered template.

getTemplateLoaderback to summary
public Function<String, String> getTemplateLoader()

Return a function that takes a template path as input and returns the template content as a String.

getUrlback to summary
public String getUrl()

Return the URL of the rendered template.