手工初始化spring beans

        private IUserService userService = null;

        @Override
	public void init(FilterConfig arg0) throws ServletException
	{
		@SuppressWarnings("resource")
		ApplicationContext context = new ClassPathXmlApplicationContext(
				"classpath*:config/spring/beans.xml");
		userService = (IUserService) context.getBean("userService");
	}

你可能感兴趣的:(spring)