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:
Aware
,BeanNameAware
,InitializingBean
,ApplicationContextAware
,View
Spring WebFlux
View
using the Mustache template engine.- Since:
- 2.0.0
- Author:
- Brian Clozel
-
Field Summary
Fields inherited from class org.springframework.web.reactive.result.view.AbstractView
logger, REQUEST_DATA_VALUE_PROCESSOR_BEAN_NAME
Fields inherited from interface org.springframework.web.reactive.result.view.View
BINDING_CONTEXT_ATTRIBUTE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
checkResourceExists
(Locale locale) protected reactor.core.publisher.Mono<Void>
renderInternal
(Map<String, Object> model, MediaType contentType, 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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.web.reactive.result.view.View
isRedirectView
-
Constructor Details
-
MustacheView
public MustacheView()
-
-
Method Details
-
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
Set the charset used for reading Mustache template files.- Parameters:
charset
- the charset to use for reading template files
-
checkResourceExists
- Specified by:
checkResourceExists
in classAbstractUrlBasedView
- Throws:
Exception
-
renderInternal
protected reactor.core.publisher.Mono<Void> renderInternal(Map<String, Object> model, MediaType contentType, ServerWebExchange exchange) - Specified by:
renderInternal
in classAbstractView
-