org.springframework.web.servlet.view.script

Interface ScriptTemplateConfig

  • All Known Implementing Classes:
    ScriptTemplateConfigurer


    public 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.
    Since:
    4.2
    Author:
    Sebastien Deleuze
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      java.nio.charset.Charset getCharset()
      Return the charset used to read script and template files.
      java.lang.String getContentType()
      Return the content type to use for the response.
      javax.script.ScriptEngine getEngine()
      Return the ScriptEngine to use by the views.
      java.lang.String getEngineName()
      Return the engine name that will be used to instantiate the ScriptEngine.
      java.lang.String getRenderFunction()
      Return the render function name (optional).
      java.lang.String getRenderObject()
      Return the object where the render function belongs (optional).
      java.lang.String getResourceLoaderPath()
      Return the resource loader path(s) via a Spring resource location.
      java.lang.String[] getScripts()
      Return the scripts to be loaded by the script engine (library or user provided).
      java.lang.Boolean isSharedEngine()
      Return whether to use a shared engine for all threads or whether to create thread-local engine instances for each thread.
    • Method Detail

      • getEngine

        @Nullable
        javax.script.ScriptEngine getEngine()
        Return the ScriptEngine to use by the views.
      • getEngineName

        @Nullable
        java.lang.String getEngineName()
        Return the engine name that will be used to instantiate the ScriptEngine.
      • isSharedEngine

        @Nullable
        java.lang.Boolean isSharedEngine()
        Return whether to use a shared engine for all threads or whether to create thread-local engine instances for each thread.
      • getScripts

        @Nullable
        java.lang.String[] getScripts()
        Return the scripts to be loaded by the script engine (library or user provided).
      • getRenderObject

        @Nullable
        java.lang.String getRenderObject()
        Return the object where the render function belongs (optional).
      • getRenderFunction

        @Nullable
        java.lang.String getRenderFunction()
        Return the render function name (optional). If not specified, the script templates will be evaluated with ScriptEngine.eval(String, Bindings).
      • getContentType

        @Nullable
        java.lang.String getContentType()
        Return the content type to use for the response.
        Since:
        4.2.1
      • getCharset

        @Nullable
        java.nio.charset.Charset getCharset()
        Return the charset used to read script and template files.
      • getResourceLoaderPath

        @Nullable
        java.lang.String getResourceLoaderPath()
        Return the resource loader path(s) via a Spring resource location.