spring-framework / org.springframework.web.reactive.config / ResourceHandlerRegistration / addResourceLocations

addResourceLocations

open fun addResourceLocations(vararg resourceLocations: String): ResourceHandlerRegistration

Add one or more resource locations from which to serve static content. Each location must point to a valid directory. Multiple locations may be specified as a comma-separated list, and the locations will be checked for a given resource in the order specified.

For example, {"/", "classpath:/META-INF/public-web-resources/"} allows resources to be served both from the web application root and from any JAR on the classpath that contains a /META-INF/public-web-resources/ directory, with resources in the web application root taking precedence.

Return
the same ResourceHandlerRegistration instance, for chained method invocation