继续浏览精彩内容
慕课网APP
程序员的梦工厂
打开
继续
感谢您的支持,我会继续努力的
赞赏金额会直接到老师账户
将二维码发送给自己后长按识别
微信支付
支付宝支付

使用@postconstruct注解和声明init-method的区别

key_xiao
关注TA
已关注
手记 7
粉丝 4
获赞 143

原问题为:

Is there any difference between using the @PostConstruct annotation and declaring the same method as init-method in Spring XML configuration?

原网址
节选最简单的答案:

@postconstruct is not part of the spring. It is part of javax package. Both are the same. using init-method we need to added in xml file.If you use @postconstruct adding in xml is not required. Check out the below article .

@postconstruct注解的使用 Demo

打开App,阅读手记
0人推荐
发表评论
随时随地看视频慕课网APP