Class MustacheView

All Implemented Interfaces:
Aware, BeanNameAware, InitializingBean, ApplicationContextAware, ServletContextAware, View

public class MustacheView extends AbstractTemplateView
Spring MVC View using the Mustache template engine.
Since:
4.0.0
Author:
Brian Clozel, Dave Syer, Phillip Webb
  • 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(@Nullable Charset charset)
      Set the Charset used for reading Mustache template files.
      Parameters:
      charset - the charset
      Since:
      4.1.0
    • setCharset

      @Deprecated(since="4.1.0", forRemoval=true) public void setCharset(@Nullable String charset)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 4.1.0 for removal in 4.3.0 in favor of setCharset(Charset)
      Set the name of the charset used for reading Mustache template files.
      Parameters:
      charset - the charset
    • checkResource

      public boolean checkResource(Locale locale) throws Exception
      Overrides:
      checkResource in class AbstractUrlBasedView
      Throws:
      Exception
    • renderMergedTemplateModel

      protected void renderMergedTemplateModel(Map<String,Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception
      Specified by:
      renderMergedTemplateModel in class AbstractTemplateView
      Throws:
      Exception