spring注解@PostConstruct


@PostConstruct是java5的时候引入的注解,指的是在项目启动的时候执行这个方法,也可以理解为在spring容器启动的时候执行,可作为一些数据的常规化加载,比如数据字典之类的。
@PostConstruct protected void initialize() { try { log.debug(
"AppInition.initialize() Start..."); Map configMap=
iSystemConfigService.getConfigMap();
ReflectUtil.reflectProperties(configMap,AppInitConstants.class); log.debug(
"AppInition.initialize() End..."); } catch (IllegalAccessException e) {
e.printStackTrace(); } }
这里 就是在加载一些常亮数据

友情链接
KaDraw流程图
API参考文档
OK工具箱
云服务器优惠
阿里云优惠券
腾讯云优惠券
华为云优惠券
站点信息
问题反馈
邮箱:ixiaoyang8@qq.com
QQ群:637538335
关注微信