Using FreeMarker to render Publisher<T> stream
FreeMarker is one of the view technologies that have extended support for Spring 5. The following recipe will illustrate how FreeMarker templates can publish Mono<T>
and Flux<T>
stream data using the Spring Reactive module.
Getting started
Add the following viewResolver
and view configuration in ch08
to compile and run FreeMarker templates.
How to do it...
Spring 5's reactive module supports FreeMarker components to provide templates to reactive contents. Let us implement FreeMarker templating using the Spring Reactive module:
- Add the newest Maven dependencies of FreeMarker in
pom.xml
:
<dependency> <groupId>org.freemarker</groupId> <artifactId>freemarker</artifactId> <version>2.3.26-incubating</version> </dependency>
- To add the reactive components to the application, include the following Maven dependency that implements the Reactor Core implementation of the Reactive...