Module io.jstach.opt.spring.webflux
Package io.jstach.opt.spring.webflux
@NonNullByDefault
package io.jstach.opt.spring.webflux
Spring Webflux integration
This package provides aAbstractSingleValueEncoder
that will encode
JStache models that are contained by Flux or Monos.
To add the encoder to your application use:
WebFluxConfigurer
.
N.B. JStachio generated code is not reactive! However in practice it matters little if your models do not contain reactive datatypes (which jstachio currently does not support anyway) and are not generating massive responses.
If you do need streaming or have a rather large result it might be best to use a Flux of models and then apply reactive operators to add header and footer.
-
ClassDescriptionEncodes a JStachio model into a bytes to be used as output from a webflux reactive controller.One way to use JStachio with Spring Webflux is to use this special View that will delegate to JStachio to render.User can provide instances in the application context and they will be applied to each
JStachioModelView
instance before rendering.ABeanPostProcessor
that it registers aHandlerResultHandler
that automatically applies allJStachioModelViewConfigurer
instances to views before rendering.