spring-framework / org.springframework.web.reactive.result.view.script / ScriptTemplateConfig

ScriptTemplateConfig

interface ScriptTemplateConfig

Interface to be implemented by objects that configure and manage a JSR-223 ScriptEngine for automatic lookup in a web environment. Detected and used by ScriptTemplateView.

Author
Sebastien Deleuze

Since
5.0

Functions

getCharset

abstract fun getCharset(): Charset

Return the charset used to read script and template files.

getEngine

abstract fun getEngine(): ScriptEngine

Return the ScriptEngine to use by the views.

getEngineName

abstract fun getEngineName(): String

Return the engine name that will be used to instantiate the ScriptEngine.

getRenderFunction

abstract fun getRenderFunction(): String

Return the render function name (optional). If not specified, the script templates will be evaluated with ScriptEngine#eval(String, Bindings).

getRenderObject

abstract fun getRenderObject(): String

Return the object where the render function belongs (optional).

getResourceLoaderPath

abstract fun getResourceLoaderPath(): String

Return the resource loader path(s) via a Spring resource location.

getScripts

abstract fun getScripts(): Array<String>

Return the scripts to be loaded by the script engine (library or user provided).

isSharedEngine

abstract fun isSharedEngine(): Boolean

Return whether to use a shared engine for all threads or whether to create thread-local engine instances for each thread.