开发者

JSF beans instantion: Are only the beans referenced in the view instantiated?

I'm guessing that if I have 6 requestscoped beans, only those referenced by the current view ( 开发者_运维百科for instance by using #{foo.bar}) are instantiated. Is that assumption correct? In that case the only bean created would be foo, and not foo2, foo3, etc that are also requestscoped or viewscoped, etc.

Does this happen to both CDI's @Named and jSF's @ManagedBean beans?


Yes, it is correct.

You can test that by logging a message / adding a breakpoint in the constructor of all beans.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜