Interface FragmentsRendering

All Superinterfaces:
SmartView, View

public interface FragmentsRendering extends SmartView
Public API for HTML rendering a collection 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 Spring MVC controller method.
Since:
6.2
Author:
Rossen Stoyanchev
  • Method Details

    • status

      Return the HTTP status to set the response to.
    • headers

      HttpHeaders headers()
      Return headers to add to the response.
    • with

      static FragmentsRendering.Builder with(String viewName, Map<String,Object> model)
      Create a builder for FragmentsRendering, adding a fragment with the given view name and model.
      Parameters:
      viewName - the name of the view for the fragment
      model - attributes for the fragment in addition to model attributes inherited from the shared model for the request
      Returns:
      the created builder
    • with

      static FragmentsRendering.Builder with(String viewName)
      Variant of with(String, Map) with a view name only, but also inheriting model attributes from the shared model for the request.
      Parameters:
      viewName - the name of the view for the fragment
      Returns:
      the created builder
    • with

      Variant of with(String, Map) with a collection of fragments.
      Parameters:
      fragments - the fragments to add; each fragment also inherits model attributes from the shared model for the request
      Returns:
      the created builder