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");
}
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");
}
相关文章推荐
- dubbo异常 DubboProtocol.createServer(DubboProtocol.java:331)
- Spring Boot的两种使用方式
- myeclipse优化
- java.lang.IllegalArgumentException: Negative time
- spring-org.springframework.beans.factory.BeanDefinitionStoreException及相关介绍
- Java 多维数组遍历
- Spring--quartz中cronExpression配置说明 (注意?说明)
- ElasticSearch学习2_Java version:1.7.0_51 suffers from critical bug及ES对JDK版本要求
- JAVA学习之 将xml导入到数据库
- Java ConcurrentModificationException 异常分析与解决方案(顶)
- java客户端和vc程序通信时的编码问题
- Java反射总结(1):解析类结构
- 【Struts2】让s:fielderror没有格式,只显示文本
- Java中获取路径的各种方法
- 将Eclipse Birt 4.5.0 源码引入Eclipse
- Java中的常用异常处理方法
- Spring中Quartz的配置
- mybatis+struts2+html(jstl)+css
- struts2 的大概工作流程
- spring学习笔记