AbstractApplicationContext ctx
=
new
ClassPathXmlApplicationContext(
new
String []{
"applicationContext.xml"
});
UserService us = (UserServiceImpl)ctx.getBean(
"UserService"
);
注意
applicationContext.xml是放在WEB-INF/classes/spring目录下,否侧找不到
查看方式 navigator 视图下 查看spring目录下是否有applicationContext.xml文件