Spring框架加载
1)非Web类:
ApplicationContext context =
new ClassPathXmlApplicationContext(new String[] {"services.xml", "applicationContext.xml"});
PersonService service = context.getBean("personService", PersonServiceImpl.class);
List personList = service.getPersonList();
2)Web类:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>