I managed to figure this out eventually. What I did instead was to use a single XML file which contained most of the servlet configuration and then had individual XML files which just set the properties file to use. Then in the web.xml I specified both of the XML files in the param-value for the servlet and they both get loaded and it uses the correct properties file. E.g. web.xml
<servlet>
<servlet-name>myAppServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/properties-context.xml /WEB-INF/servlet-context.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
Where properties-context.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" p:location="classpath:my.properties" />
</beans>
And servlet-context.xml is a regular Spring servlet context file which uses ${} for any properties to load from my.properties.