springMVC 启动时 加载数据

实现 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");
}

 

posted @ 2015-10-23 10:58  淡烟  阅读(460)  评论(0)    收藏  举报