Class MustacheView

java.lang.Object
org.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
org.springframework.web.servlet.view.AbstractView
org.springframework.web.servlet.view.AbstractUrlBasedView
org.springframework.web.servlet.view.AbstractTemplateView
org.springframework.boot.web.servlet.view.MustacheView
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, org.springframework.web.context.ServletContextAware, org.springframework.web.servlet.View

public class MustacheView extends org.springframework.web.servlet.view.AbstractTemplateView
Spring MVC View using the Mustache template engine.
Since:
2.0.0
  • Field Summary

    Fields inherited from class org.springframework.web.servlet.view.AbstractTemplateView

    SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE

    Fields inherited from class org.springframework.web.servlet.view.AbstractView

    DEFAULT_CONTENT_TYPE

    Fields inherited from class org.springframework.context.support.ApplicationObjectSupport

    logger

    Fields inherited from interface org.springframework.web.servlet.View

    PATH_VARIABLES, RESPONSE_STATUS_ATTRIBUTE, SELECTED_CONTENT_TYPE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    protected void
    renderMergedTemplateModel(Map<String,Object> model, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
     
    void
    setCharset(String charset)
    Set the charset used for reading Mustache template files.
    void
    setCompiler(com.samskivert.mustache.Mustache.Compiler compiler)
    Set the Mustache compiler to be used by this view.

    Methods inherited from class org.springframework.web.servlet.view.AbstractTemplateView

    applyContentType, renderMergedOutputModel, setAllowRequestOverride, setAllowSessionOverride, setExposeRequestAttributes, setExposeSessionAttributes, setExposeSpringMacroHelpers

    Methods inherited from class org.springframework.web.servlet.view.AbstractUrlBasedView

    afterPropertiesSet, getUrl, isUrlRequired, setUrl, toString

    Methods inherited from class org.springframework.web.servlet.view.AbstractView

    addStaticAttribute, createMergedOutputModel, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, formatViewName, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getRequestToExpose, getStaticAttributes, isExposePathVariables, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setExposeContextBeansAsAttributes, setExposedContextBeanNames, setExposePathVariables, setRequestContextAttribute, setResponseContentType, writeToResponse

    Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport

    getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext

    Methods inherited from class org.springframework.context.support.ApplicationObjectSupport

    getApplicationContext, getMessageSourceAccessor, initApplicationContext, obtainApplicationContext, requiredContextClass, setApplicationContext

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MustacheView

      public MustacheView()
  • Method Details

    • setCompiler

      public void setCompiler(com.samskivert.mustache.Mustache.Compiler compiler)
      Set the Mustache compiler to be used by this view.

      Typically this property is not set directly. Instead a single Mustache.Compiler is expected in the Spring application context which is used to compile Mustache templates.

      Parameters:
      compiler - the Mustache compiler
    • setCharset

      public void setCharset(String charset)
      Set the charset used for reading Mustache template files.
      Parameters:
      charset - the charset to use for reading template files
    • checkResource

      public boolean checkResource(Locale locale) throws Exception
      Overrides:
      checkResource in class org.springframework.web.servlet.view.AbstractUrlBasedView
      Throws:
      Exception
    • renderMergedTemplateModel

      protected void renderMergedTemplateModel(Map<String,Object> model, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws Exception
      Specified by:
      renderMergedTemplateModel in class org.springframework.web.servlet.view.AbstractTemplateView
      Throws:
      Exception