您的位置:首页 > 编程语言 > Java开发

springMVC 启动时 加载数据

2015-10-23 10:58 267 查看
实现 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");
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: