I have defined the contextConfigLocation(s) in web.xml as follows:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/root-context.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>appServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/app/servlet-context.xml</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>appServlet</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
In the root-context.xml, I have
<context:property-placeholder location="${propFile}" />
Now, I observe that no properties required in the Spring bean configured in the servlet-context.xml or its child context xml (beans:import) can be resolved, though they are clearly defined in the propFile and are resolvable from the root-context.xml or its child context xml.
Also, what is more painful is
if I define mvc:interceptor with mvc:mapping path="/"** inside root-context.xml, the interceptor is not invoked for request pattern ="/rest/*". But the same interceptor is invoked successfully if configured inside servlet-context.xml or its child xml.
Please let me know if I am missing something or is that the expected behavior?
Environment:
Java version: 1.8.0_60, vendor: Oracle Corporation
OS name: "windows 7", version: "6.1", arch: "amd64", family: "dos"
The version of the most of my Spring dependencies like (spring-context, spring-beans etc.) are resolved by io.spring.platform:platform-bom:Brussels-SR3 to be 4.3.9.RELEASE