Skip to content

Commit

Permalink
Do not sort the mvc:resources location attribute
Browse files Browse the repository at this point in the history
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
  • Loading branch information
philwebb committed Mar 6, 2013
1 parent 85f8d6f commit 7bc5353
Showing 1 changed file with 3 additions and 2 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,6 +16,7 @@

package org.springframework.web.servlet.config;

import java.util.Arrays;
import java.util.Map;

import org.w3c.dom.Element;
Expand Down Expand Up @@ -89,7 +90,7 @@ private String registerResourceHandler(ParserContext parserContext, Element elem
}

ManagedList<String> locations = new ManagedList<String>();
locations.addAll(StringUtils.commaDelimitedListToSet(locationAttr));
locations.addAll(Arrays.asList(StringUtils.commaDelimitedListToStringArray(locationAttr)));

RootBeanDefinition resourceHandlerDef = new RootBeanDefinition(ResourceHttpRequestHandler.class);
resourceHandlerDef.setSource(source);
Expand Down

0 comments on commit 7bc5353

Please sign in to comment.