Skip to content

Commit d26421f

Browse files
committed
Fix missing ResourceHttpRequestHandler init in registry
Issue: SPR-14577 Cherry-picked from: 7a88776
1 parent 3767092 commit d26421f

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/ResourceHandlerRegistry.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ protected AbstractHandlerMapping getHandlerMapping() {
142142
handler.setContentNegotiationManager(this.contentNegotiationManager);
143143
try {
144144
handler.afterPropertiesSet();
145+
handler.afterSingletonsInstantiated();
145146
}
146147
catch (Exception ex) {
147148
throw new BeanInitializationException("Failed to init ResourceHttpRequestHandler", ex);

spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/ResourceHandlerRegistryTests.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2015 the original author or authors.
2+
* Copyright 2002-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -79,8 +79,6 @@ public void mapPathToLocation() throws Exception {
7979
request.setAttribute(HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, "/testStylesheet.css");
8080

8181
ResourceHttpRequestHandler handler = getHandler("/resources/**");
82-
handler.afterPropertiesSet();
83-
handler.afterSingletonsInstantiated();
8482
handler.handleRequest(request, this.response);
8583

8684
assertEquals("test stylesheet content", this.response.getContentAsString());

0 commit comments

Comments
 (0)