当用@PostConstruct标记的方法调用时? [英] When method marked with @PostConstruct called?

查看:133
本文介绍了当用@PostConstruct标记的方法调用时?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在JSF请求处理生命周期的哪个阶段,用@PostConstruct标记的支持bean方法调用?

At which phase of the JSF request processing lifecycle, the backing bean method marked with @PostConstruct called?

推荐答案

标记的方法在创建bean之后,将调用 @PostConstruct ,注入依赖项,设置所有托管属性,并在bean实际设置为范围之前。

Methods marked with the @PostConstruct will be invoked after the bean has been created, dependencies have been injected, all managed properties are set, and before the bean is actually set into scope.

发现相关的SO主题,可能不完全相同,但它会回答您的问题。并博客条目解释相同的内容。

Found related SO thread, might not be exactly same but it answers your question. And a blog entry explaining the same.

这篇关于当用@PostConstruct标记的方法调用时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆