@postconstruct实例
时间: 2023-09-02 22:11:08 浏览: 83
@PostConstruct是一个注解,用于修饰一个非静态的void方法。它表示该方法在Spring实例化Bean之后立即执行。被@PostConstruct修饰的方法通常用于在依赖关系注入完成后执行任何初始化操作。这些方法只会在服务器加载Servlet时执行一次。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [Java spring 注解 @PostConstruct 实战讲解](https://blog.csdn.net/weixin_44259720/article/details/130385797)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *2* [@PostConstruct注解及用处示例](https://blog.csdn.net/yfyh2021/article/details/121930899)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文