Skip to content

Commit 7bc5353

Browse files
committed
Do not sort the mvc:resources location attribute
Update ResourcesBeanDefinitionParser to use ensure that location attribute values remain in the order that they are specified. The order was inadvertently changed in commit 3838d159f3 due to the use of StringUtils.commaDelimitedListToSet which sorts items. Issue: SPR-10355
1 parent 85f8d6f commit 7bc5353

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2013 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.
@@ -16,6 +16,7 @@
1616

1717
package org.springframework.web.servlet.config;
1818

19+
import java.util.Arrays;
1920
import java.util.Map;
2021

2122
import org.w3c.dom.Element;
@@ -89,7 +90,7 @@ private String registerResourceHandler(ParserContext parserContext, Element elem
8990
}
9091

9192
ManagedList<String> locations = new ManagedList<String>();
92-
locations.addAll(StringUtils.commaDelimitedListToSet(locationAttr));
93+
locations.addAll(Arrays.asList(StringUtils.commaDelimitedListToStringArray(locationAttr)));
9394

9495
RootBeanDefinition resourceHandlerDef = new RootBeanDefinition(ResourceHttpRequestHandler.class);
9596
resourceHandlerDef.setSource(source);

0 commit comments

Comments
 (0)