spring-framework / org.springframework.web.servlet.view.script / ScriptTemplateView

ScriptTemplateView

open class ScriptTemplateView : AbstractUrlBasedView

An AbstractUrlBasedView subclass designed to run any template library based on a JSR-223 script engine.

If not set, each property is auto-detected by looking up a single ScriptTemplateConfig bean in the web application context and using it to obtain the configured properties.

The Nashorn JavaScript engine requires Java 8+ and may require setting the sharedEngine property to false in order to run properly. See ScriptTemplateConfigurer#setSharedEngine(Boolean) for more details.

Author
Sebastien Deleuze

Author
Juergen Hoeller

Since
4.2

See Also
ScriptTemplateConfigurerScriptTemplateViewResolver

Constructors

<init>

ScriptTemplateView()

Constructor for use as a bean.

ScriptTemplateView(url: String)

Create a new ScriptTemplateView with the given URL.

Properties

DEFAULT_CONTENT_TYPE

static val DEFAULT_CONTENT_TYPE: String

Functions

checkResource

open fun checkResource(locale: Locale): Boolean

setCharset

open fun setCharset(charset: Charset): Unit

See ScriptTemplateConfigurer#setCharset(Charset) documentation.

setEngine

open fun setEngine(engine: ScriptEngine): Unit

See ScriptTemplateConfigurer#setEngine(ScriptEngine) documentation.

setEngineName

open fun setEngineName(engineName: String): Unit

See ScriptTemplateConfigurer#setEngineName(String) documentation.

setRenderFunction

open fun setRenderFunction(functionName: String): Unit

See ScriptTemplateConfigurer#setRenderFunction(String) documentation.

setRenderObject

open fun setRenderObject(renderObject: String): Unit

See ScriptTemplateConfigurer#setRenderObject(String) documentation.

setResourceLoaderPath

open fun setResourceLoaderPath(resourceLoaderPath: String): Unit

See ScriptTemplateConfigurer#setResourceLoaderPath(String) documentation.

setScripts

open fun setScripts(vararg scripts: String): Unit

See ScriptTemplateConfigurer#setScripts(String...) documentation.

setSharedEngine

open fun setSharedEngine(sharedEngine: Boolean): Unit

See ScriptTemplateConfigurer#setSharedEngine(Boolean) documentation.