Package de.otto.esidialect
Class EsiDialectConfiguration
java.lang.Object
de.otto.esidialect.EsiDialectConfiguration
@Configuration
@EnableConfigurationProperties(EsiDialectProperties.class)
@ConditionalOnProperty(prefix="esiinclude-thymeleaf-dialect",
value="dialect-enabled",
havingValue="true")
public class EsiDialectConfiguration
extends Object
Configures the thymeleaf
<esi:include> dialect.
You need to provide a fetch function that takes the source url as parameter and returns a response object with the result and status.
This library has a compile-only dependency on thymeleaf3. The user of this library needs to provide the thymeleaf3 dependency at runtime, so that the EsiDialect bean is created and automatically registered as another esi-dialect by spring.
Furthermore this library has a compile-only dependency on com.ning:async-http-client. When this library is provided at runtime, a fetch-function bean is created that uses AsyncHttpClient internally. A user of this library is free to override this bean definition or provide a different implementation for the fetch-function.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconditionalEsiDialect(EsiContentResolver esiContentResolver, EsiDialectProperties properties) esiContentResolver(Fetch fetch, EsiDialectProperties properties)
-
Constructor Details
-
EsiDialectConfiguration
public EsiDialectConfiguration()
-
-
Method Details
-
conditionalEsiDialect
@Bean @ConditionalOnClass(org.thymeleaf.processor.element.AbstractElementTagProcessor.class) @ConditionalOnMissingBean(EsiDialect.class) public EsiDialect conditionalEsiDialect(EsiContentResolver esiContentResolver, EsiDialectProperties properties) -
esiContentResolver
@Bean @ConditionalOnClass(org.thymeleaf.processor.element.AbstractElementTagProcessor.class) @ConditionalOnMissingBean(EsiContentResolver.class) public EsiContentResolver esiContentResolver(Fetch fetch, EsiDialectProperties properties)
-