[b]获取注释方式(Annotaction)的bean[/b]
[b]获取ApplicationContext.xml中的bean[/b]
WebApplicationContext wac = WebApplicationContextUtils.getWebApplicationContext(config.getServletContext());
TestService testService= (TestService) wac.getBean("TestService");
[b]获取ApplicationContext.xml中的bean[/b]
BeanFactory factory = new ClassPathXmlApplicationContext("classpath:/applicationContext*.xml");
ITestService testService = (ITestService)factory.getBean("test-service");