ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml"); CustomerService userService = (CustomerService) ac.getBean("customerService"); Customer cust = userService.queryByCertId("371424192308073611"); // Userinfo userinfo = user.geUserinfoByid(1); if(cust != null){ System.out.println(cust.getCustomerName()); }
@Scope("prototype")