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 Fragment
Create a Fragment with a view name only, inheriting model attributes from the top-level model for the request.static Fragment
Create a Fragment with a view name and a model, also inheriting model attributes from the top-level model for the request.static Fragment
Variant ofcreate(String, Map)
with a resolvedView
.boolean
Whether this Fragment contains a resolvedView
instance.void
mergeAttributes
(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 resolvedView
instance.viewName()
Return the view name of the Fragment, ornull
if not set.
-
Method Details
-
isResolved
public boolean isResolved()Whether this Fragment contains a resolvedView
instance. -
viewName
Return the view name of the Fragment, ornull
if not set. -
view
Return the resolvedView
instance. 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
.
-