File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
spring-webmvc/src/main/java/org/springframework/web/servlet/view Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 1919import java .io .IOException ;
2020import java .util .ArrayList ;
2121import java .util .Collection ;
22+ import java .util .Collections ;
2223import java .util .Locale ;
2324import java .util .Map ;
2425
@@ -59,7 +60,7 @@ final class DefaultFragmentsRendering implements FragmentsRendering {
5960
6061 this .status = status ;
6162 this .headers = headers ;
62- this .modelAndViews = new ArrayList <>(fragments );
63+ this .modelAndViews = Collections . unmodifiableCollection ( new ArrayList <>(fragments ) );
6364 }
6465
6566
@@ -79,6 +80,12 @@ public boolean isRedirectView() {
7980 return false ;
8081 }
8182
83+ @ Override
84+ public Collection <ModelAndView > fragments () {
85+ return this .modelAndViews ;
86+ }
87+
88+
8289 @ Override
8390 public void resolveNestedViews (ViewResolver resolver , Locale locale ) throws Exception {
8491 for (ModelAndView mv : this .modelAndViews ) {
Original file line number Diff line number Diff line change @@ -53,6 +53,12 @@ public interface FragmentsRendering extends SmartView {
5353 */
5454 HttpHeaders headers ();
5555
56+ /**
57+ * Return the {@code ModelAndView} for each fragment.
58+ * @since 6.2.15
59+ */
60+ Collection <ModelAndView > fragments ();
61+
5662
5763 /**
5864 * Create a builder with one HTML fragment, also inheriting attributes from
You can’t perform that action at this time.
0 commit comments