How to use view scope in case of CDI in JSF 2.0

可紊 提交于 2019-11-30 23:11:53

There is no view scope for CDI. The conversation scope is not the same. A view scoped bean lives as long as you work with the same view and survives partial or full reloads of the page.

If you want to use CDI's conversation scope, your application has to set the beginning and end of the conversation.

From my experience you can use CDI scopes together with JSF's view scope (e.g. use CDI scopes for session and application beans and JSF view scope where you need it).

UPDATE: However, you can't inject a managad bean into a CDI bean. The other way around works. And that is the more common case (injecting from a broader scope into the narrower).

simply just put seam3 faces module in your classpath or use @ViewAccessScpoed annotation of myfaces CODI.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!