Class MustacheView
java.lang.Object
org.springframework.web.reactive.result.view.AbstractView
org.springframework.web.reactive.result.view.AbstractUrlBasedView
org.springframework.boot.mustache.reactive.view.MustacheView
- All Implemented Interfaces:
Aware, BeanNameAware, InitializingBean, ApplicationContextAware, View
Spring WebFlux
View using the Mustache template engine.- Since:
- 4.0.0
- Author:
- Brian Clozel
-
Field Summary
Fields inherited from class AbstractView
logger, REQUEST_DATA_VALUE_PROCESSOR_BEAN_NAMEFields inherited from interface View
BINDING_CONTEXT_ATTRIBUTE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckResourceExists(Locale locale) protected reactor.core.publisher.Mono<Void> renderInternal(Map<String, Object> model, @Nullable MediaType contentType, ServerWebExchange exchange) voidsetCharset(@Nullable String charset) Deprecated, for removal: This API element is subject to removal in a future version.voidsetCharset(@Nullable Charset charset) Set theCharsetused for reading Mustache template files.voidsetCompiler(com.samskivert.mustache.Mustache.Compiler compiler) Set the JMustache compiler to be used by this view.Methods inherited from class AbstractUrlBasedView
afterPropertiesSet, getUrl, resourceExists, setUrl, toStringMethods inherited from class AbstractView
createRequestContext, formatViewName, getApplicationContext, getBeanName, getDefaultCharset, getModelAttributes, getRequestContextAttribute, getRequestDataValueProcessor, getSupportedMediaTypes, obtainApplicationContext, render, resolveAsyncAttributes, setApplicationContext, setBeanName, setDefaultCharset, setRequestContextAttribute, setSupportedMediaTypesMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface 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.Compileris expected in the Spring application context which is used to compile Mustache templates.- Parameters:
compiler- the Mustache compiler
-
setCharset
-
setCharset
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 ofsetCharset(Charset)Set the name of the charset used for reading Mustache template files.- Parameters:
charset- the charset
-
checkResourceExists
- Specified by:
checkResourceExistsin classAbstractUrlBasedView- Throws:
Exception
-
renderInternal
protected reactor.core.publisher.Mono<Void> renderInternal(Map<String, Object> model, @Nullable MediaType contentType, ServerWebExchange exchange) - Specified by:
renderInternalin classAbstractView
-
setCharset(Charset)