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
-
- com.github.mjeanroy.springmvc.view.mustache.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
Implementation of mustache view. Use jmustache internally as template compiler.
-
-
Constructor Summary
Constructors Constructor Description MustacheView()
Build new view.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAlias(String key, String value)
Add alias mapping.void
addAliases(Map<String,String> aliases)
Add partials mapping.Map<String,String>
getAliases()
Get list of aliases that map alias name to partial path.MustacheCompiler
getCompiler()
Get compiler that will be used to compile view.protected void
renderMergedTemplateModel(Map<String,Object> model, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
void
setCompiler(MustacheCompiler compiler)
Set new mustache compiler that can be used to compile view.String
toString()
-
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, checkResource, getUrl, isUrlRequired, setUrl
-
Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createMergedOutputModel, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, 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
-
-
-
-
Method Detail
-
setCompiler
public void setCompiler(MustacheCompiler compiler)
Set new mustache compiler that can be used to compile view.- Parameters:
compiler
- Mustache compiler.
-
getCompiler
public MustacheCompiler getCompiler()
Get compiler that will be used to compile view.- Returns:
- Mustache compiler.
-
addAliases
public void addAliases(Map<String,String> aliases)
Add partials mapping.- Parameters:
aliases
- New aliases.
-
addAlias
public void addAlias(String key, String value)
Add alias mapping.- Parameters:
key
- Partial key.value
- Partial name.
-
getAliases
public Map<String,String> getAliases()
Get list of aliases that map alias name to partial path.- Returns:
- Aliases.
-
renderMergedTemplateModel
protected void renderMergedTemplateModel(Map<String,Object> model, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
- Specified by:
renderMergedTemplateModel
in classorg.springframework.web.servlet.view.AbstractTemplateView
- Throws:
Exception
-
toString
public String toString()
- Overrides:
toString
in classorg.springframework.web.servlet.view.AbstractUrlBasedView
-
-