Class MustacheView
- java.lang.Object
- org.springframework.web.reactive.result.view.AbstractView
- org.springframework.web.reactive.result.view.AbstractUrlBasedView
- org.springframework.boot.web.reactive.result.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.reactive.result.view.View
public class MustacheView extends org.springframework.web.reactive.result.view.AbstractUrlBasedView
Spring WebFluxView
using the Mustache template engine.- Since:
- 2.0.0
Constructor Summary
Constructors Constructor Description MustacheView()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
checkResourceExists(Locale locale)
protected reactor.core.publisher.Mono<Void>
renderInternal(Map<String,Object> model, org.springframework.http.MediaType contentType, org.springframework.web.server.ServerWebExchange exchange)
void
setCharset(String charset)
Set the charset used for reading Mustache template files.void
setCompiler(com.samskivert.mustache.Mustache.Compiler compiler)
Set the JMustache compiler to be used by this view.Methods inherited from class org.springframework.web.reactive.result.view.AbstractUrlBasedView
afterPropertiesSet, getUrl, setUrl, toString
Methods inherited from class org.springframework.web.reactive.result.view.AbstractView
createRequestContext, formatViewName, getApplicationContext, getBeanName, getDefaultCharset, getModelAttributes, getRequestContextAttribute, getRequestDataValueProcessor, getSupportedMediaTypes, obtainApplicationContext, render, resolveAsyncAttributes, setApplicationContext, setBeanName, setDefaultCharset, setRequestContextAttribute, setSupportedMediaTypes
Constructor Detail
MustacheView
public MustacheView()
Method Detail
setCompiler
public void setCompiler(com.samskivert.mustache.Mustache.Compiler compiler)
Set the JMustache compiler to be used by this view. Typically this property is not set directly. Instead a singleMustache.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
checkResourceExists
public boolean checkResourceExists(Locale locale) throws Exception
- Specified by:
checkResourceExists
in classorg.springframework.web.reactive.result.view.AbstractUrlBasedView
- Throws:
Exception
renderInternal
protected reactor.core.publisher.Mono<Void> renderInternal(Map<String,Object> model, org.springframework.http.MediaType contentType, org.springframework.web.server.ServerWebExchange exchange)
- Specified by:
renderInternal
in classorg.springframework.web.reactive.result.view.AbstractView