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

浙公网安备 33010602011771号