实现 org.springframework.beans.factory.InitializingBean接口,重写afterPropertiesSet方法
public class Servlet implements InitializingBean{
@Autowired
private CustomerMailService customerMailService;
@Override
public void afterPropertiesSet() throws Exception {
// TODO Auto-generated method stub
System.out.println("----------------------------------------------->>>>>");
customerMailService.getCustomerMail();
System.out.println("-------------++++++++++++++++++++----------------->test");
}
时间: 2024-08-05 01:30:48