Class Fragment
java.lang.Object
org.springframework.web.reactive.result.view.Fragment
Container for a model and a view for use with
FragmentsRendering and
multi-view rendering. For full page rendering with a single model and view,
use Rendering.- Since:
- 6.2
- Author:
- Rossen Stoyanchev
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic FragmentCreate a Fragment with a view name only, inheriting model attributes from the top-level model for the request.static FragmentCreate a Fragment with a view name and a model, also inheriting model attributes from the top-level model for the request.static FragmentVariant ofcreate(String, Map)with a resolvedView.booleanWhether this Fragment contains a resolvedViewinstance.voidmergeAttributes(Model model) Merge attributes from the request model if not already present.model()Return the model for this Fragment, or an empty map.toString()view()Return the resolvedViewinstance.viewName()Return the view name of the Fragment, ornullif not set.
-
Method Details
-
isResolved
public boolean isResolved()Whether this Fragment contains a resolvedViewinstance. -
viewName
Return the view name of the Fragment, ornullif not set. -
view
Return the resolvedViewinstance. This should be called only after anisResolved()check. -
model
Return the model for this Fragment, or an empty map. -
mergeAttributes
Merge attributes from the request model if not already present. -
toString
-
create
Create a Fragment with a view name and a model, also inheriting model attributes from the top-level model for the request. -
create
Create a Fragment with a view name only, inheriting model attributes from the top-level model for the request. -
create
Variant ofcreate(String, Map)with a resolvedView.
-