org.springframework.web.reactive.result.view.script

Class RenderingContext

  • java.lang.Object
    • org.springframework.web.reactive.result.view.script.RenderingContext


  • public class RenderingContext
    extends java.lang.Object
    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.
    Since:
    5.0
    Author:
    Sebastien Deleuze
    • Constructor Summary

      Constructors 
      Constructor and Description
      RenderingContext(ApplicationContext applicationContext, java.util.Locale locale, java.util.function.Function<java.lang.String,java.lang.String> templateLoader, java.lang.String url)
      Create a new RenderingContext.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      ApplicationContext getApplicationContext()
      Return the application context.
      java.util.Locale getLocale()
      Return the locale of the rendered template.
      java.util.function.Function<java.lang.String,java.lang.String> getTemplateLoader()
      Return a function that takes a template path as input and returns the template content as a String.
      java.lang.String getUrl()
      Return the URL of the rendered template.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RenderingContext

        public RenderingContext(ApplicationContext applicationContext,
                                java.util.Locale locale,
                                java.util.function.Function<java.lang.String,java.lang.String> templateLoader,
                                java.lang.String url)
        Create a new RenderingContext.
        Parameters:
        applicationContext - the application context
        locale - the locale of the rendered template
        templateLoader - a function that takes a template path as input and returns the template content as a String
        url - the URL of the rendered template
    • Method Detail

      • getApplicationContext

        public ApplicationContext getApplicationContext()
        Return the application context.
      • getLocale

        public java.util.Locale getLocale()
        Return the locale of the rendered template.
      • getTemplateLoader

        public java.util.function.Function<java.lang.String,java.lang.String> getTemplateLoader()
        Return a function that takes a template path as input and returns the template content as a String.
      • getUrl

        public java.lang.String getUrl()
        Return the URL of the rendered template.