Im not 100% sure - please correct me if You know better - but in fact
myApplicationContext.xml is Your
ROOT WebApplicationContext, not just ApplicationContext.
Now take a look at javadoc of
WebApplicationContextUtils.getWebApplicationContext(servletContext):
Find the ROOT WebApplicationContext for this web application, which is typically loaded via ContextLoaderListener or ContextLoaderServlet.
That is why it gives You application context from myApplicationContext.xml instead of myWebApplicationContext.xml.