@PostConstruct 使用方法

做用:在應用啓動以前啓動代碼it

好比:方法

@PostConstruct public void init() {異常

    System.out.println("增長業務代碼地方");參數

}void

@PostConstruct 使用注意事項struct

一、方法無任何參數

二、方法無任何返回值

三、方法內不能拋出異常

四、default-lazy-init="false",不能配成true

相關文章
相關標籤/搜索