Browse Source

Refine "Redirecting to a resource" section code sample

The commit updates the code sample to use a null element friendly list.

Closes gh-32423
pull/32494/head
Sébastien Deleuze 2 years ago
parent
commit
9cc74e78f8
  1. 2
      framework-docs/modules/ROOT/pages/web/webflux-functional.adoc
  2. 2
      framework-docs/modules/ROOT/pages/web/webmvc-functional.adoc

2
framework-docs/modules/ROOT/pages/web/webflux-functional.adoc

@ -803,7 +803,7 @@ Java:: @@ -803,7 +803,7 @@ Java::
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
----
ClassPathResource index = new ClassPathResource("static/index.html");
List<String> extensions = List.of("js", "css", "ico", "png", "jpg", "gif");
List<String> extensions = Arrays.asList("js", "css", "ico", "png", "jpg", "gif");
RequestPredicate spaPredicate = path("/api/**").or(path("/error")).or(pathExtension(extensions::contains)).negate();
RouterFunction<ServerResponse> redirectToIndex = route()
.resource(spaPredicate, index)

2
framework-docs/modules/ROOT/pages/web/webmvc-functional.adoc

@ -781,7 +781,7 @@ Java:: @@ -781,7 +781,7 @@ Java::
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
----
ClassPathResource index = new ClassPathResource("static/index.html");
List<String> extensions = List.of("js", "css", "ico", "png", "jpg", "gif");
List<String> extensions = Arrays.asList("js", "css", "ico", "png", "jpg", "gif");
RequestPredicate spaPredicate = path("/api/**").or(path("/error")).or(pathExtension(extensions::contains)).negate();
RouterFunction<ServerResponse> redirectToIndex = route()
.resource(spaPredicate, index)

Loading…
Cancel
Save