How to use viewport in case of CDI in JSF 2.0

I created a JSF 2.0 project in NetBeans 6.9. I am starting to use CDI. After creating the project, when I tried to add an area, I noticed that there was no viewcope in it. I want to know that the conversation area and the viewing area apply to the same things? Can I use the talking area instead of the viewing area. If not, how can I use the viewport with CDI. I also found out that a seam is a solution, but how can I use a seam with netbeans. Is there a netbeans plugin for seam? Seam-3

thanks

+4
source share
2 answers

There is no viewport for CDI. The difference in conversation is not the same. An object with a bean span lives as long as you work with the same view and save a partial or full page reload.

If you want to use the CDI conversation area, your application must set the beginning and end of the conversation.

From my experience, you can use CDI scopes with JSF scope (for example, use CDI scopes for the session and beans application and the JSF viewport where you need it).

UPDATE: However, you cannot enter the bean control command in the CDI bean. Another thing. And this is a more common case (introducing a wider circle into a narrower one).

+10
source

just put the seam3 faces file in your classpath or use the @ViewAccessScpoed annotation myfaces CODI.

0
source

Source: https://habr.com/ru/post/1399958/


All Articles