springMvc中获取spring中的bean,该如何处理

springMvc中获取spring中的bean
我有个类,web.xml 配置 
<servlet>
<servlet-name>vdc_ui</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>  
        <param-name>contextConfigLocation</param-name>  
        <param-value>classpath:spring/applicationContext-servlet.xml</param-value>
        <load-on-startup>1</load-on-startup>
    </init-param>
</servlet>
applicationContext-servlet.xml中,配置了一个bean,这个bean
<bean id="testA" class="com.bb.testA"></bean>

在controllerer中的某个方法里,使用下面的代码获取:
WebApplicationContext webApplicationContext = ContextLoader.getCurrentWebApplicationContext();
service=(LogInjectionSaf)webApplicationContextgetBean("testA");
为什么显示 service为null呢,怎么才能得到?
------解决思路----------------------
WebApplicationContext webApplicationContext = ContextLoader.getCurrentWebApplicationContext();
这个拿到的是父容器,而testA装配在了applicationContext-servlet子容器里。父容器无法取得子容器bean,反之则可以。
因此,要取得子容器里的testA bean,需要先拿到子容器,如下:

WebApplicationContext webApplicationContext = WebApplicationContextUtils.getWebApplicationContext(servletContext,"org.springframework.web.servlet.FrameworkServlet.CONTEXT.vdc_ui" );
TestA service=(TestA)webApplicationContext.getBean("testA");