Polishing

This commit is contained in:
Juergen Hoeller
2017-11-11 00:37:50 +01:00
parent 87375fe6f8
commit 72f20e8d4f
5 changed files with 42 additions and 28 deletions

View File

@@ -93,12 +93,11 @@ public class ResourceHandlerRegistry {
/**
* A variant of
* {@link #ResourceHandlerRegistry(ApplicationContext, ServletContext, ContentNegotiationManager)}
* that also accepts the {@link UrlPathHelper} used for mapping requests
* to static resources.
* that also accepts the {@link UrlPathHelper} used for mapping requests to static resources.
* @since 4.3.13
*/
public ResourceHandlerRegistry(ApplicationContext applicationContext, ServletContext servletContext,
ContentNegotiationManager contentNegotiationManager, @Nullable UrlPathHelper pathHelper) {
@Nullable ContentNegotiationManager contentNegotiationManager, @Nullable UrlPathHelper pathHelper) {
Assert.notNull(applicationContext, "ApplicationContext is required");
this.applicationContext = applicationContext;
@@ -109,13 +108,12 @@ public class ResourceHandlerRegistry {
/**
* Add a resource handler for serving static resources based on the specified URL path
* patterns. The handler will be invoked for every incoming request that matches to
* one of the specified path patterns.
* <p>Patterns like {@code "/static/**"} or {@code "/css/{filename:\\w+\\.css}"}
* are allowed. See {@link org.springframework.util.AntPathMatcher} for more details on the
* syntax.
* @return A {@link ResourceHandlerRegistration} to use to further configure the
* Add a resource handler for serving static resources based on the specified URL path patterns.
* The handler will be invoked for every incoming request that matches to one of the specified
* path patterns.
* <p>Patterns like {@code "/static/**"} or {@code "/css/{filename:\\w+\\.css}"} are allowed.
* See {@link org.springframework.util.AntPathMatcher} for more details on the syntax.
* @return a {@link ResourceHandlerRegistration} to use to further configure the
* registered resource handler
*/
public ResourceHandlerRegistration addResourceHandler(String... pathPatterns) {