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.
精彩评论