Interface FragmentsRendering
public interface FragmentsRendering
Public API for HTML rendering from a collection or from a stream of
 
Fragments each with its own view and model. For use with
 view technologies such as htmx where multiple
 page fragments may be rendered in a single response. Supported as a return
 value from a WebFlux controller method.
 For full page rendering with a single model and view, use Rendering.
- Since:
- 6.2
- Author:
- Rossen Stoyanchev
- 
Nested Class SummaryNested Classes
- 
Method SummaryModifier and TypeMethodDescriptionreactor.core.publisher.Flux<Fragment>Return the fragments to render.headers()Return headers to add to the response.status()Return the HTTP status to set the response to.static FragmentsRendering.BuilderCreate a builder and add a fragment with a view name only, also inheriting model attributes from the model for the request.static FragmentsRendering.BuilderCreate a builder and add a fragment with a view name and a model.static FragmentsRendering.BuilderwithCollection(Collection<Fragment> fragments) Create a builder to render with a collection of Fragments.static FragmentsRendering.BuilderwithProducer(Object fragmentsProducer) Variant ofwithPublisher(Publisher)that allows using any producer that can be resolved toPublisherviaReactiveAdapterRegistry.static <P extends Publisher<Fragment>>
 FragmentsRendering.BuilderwithPublisher(P fragmentsPublisher) Create a builder to render with aPublisherof Fragments.
- 
Method Details- 
statusReturn the HTTP status to set the response to.
- 
headersHttpHeaders headers()Return headers to add to the response.
- 
fragmentsreactor.core.publisher.Flux<Fragment> fragments()Return the fragments to render.
- 
withCreate a builder and add a fragment with a view name and a model.- Parameters:
- viewName- the name of the view for the fragment
- model- attributes for the fragment in addition to model attributes inherited from the model for the request
- Returns:
- this builder
 
- 
withCreate a builder and add a fragment with a view name only, also inheriting model attributes from the model for the request.- Parameters:
- viewName- the name of the view for the fragment
- Returns:
- this builder
 
- 
withCollectionCreate a builder to render with a collection of Fragments.
- 
withPublisherstatic <P extends Publisher<Fragment>> FragmentsRendering.Builder withPublisher(P fragmentsPublisher) Create a builder to render with aPublisherof Fragments.
- 
withProducerVariant ofwithPublisher(Publisher)that allows using any producer that can be resolved toPublisherviaReactiveAdapterRegistry.
 
-