New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CDI portable extension for @ViewScoped #1087
Comments
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented
|
@glassfishrobot Commented
Any pointers to that? If JSF native managed beans are ever to be deprecated these problems should of course be fixed. Possibly #787 makes this job easier. |
@glassfishrobot Commented |
@glassfishrobot Commented Currently I have headache with CODI mapping / porting of JSF @ViewScope to CDI (see Gerhard's link). This is quite good with OWB, but not with Weld. @Inject in a base class doesn't work in JBoss 7 if the derived class has JSF @ViewScope. It works if it has CODI's @ViewAccessScope. But not with @ViewScope. Example:
It works with OWB as I said. And it works in Weld too if I move @Inject ... to the class B. Sorry for off-topic, but I think this is because Weld doesn't know about mapping of ViewScope.class, there isn't a SPI Extension in META-INF/services (no new annotation). Right? Sorry again. |
@glassfishrobot Commented |
@glassfishrobot Commented 1. move javax.faces.flow.ViewScoped to javax.faces.view.ViewScoped. 2. Rename implicit object to be "flowScope" instead of "facesFlowScope". |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
|
For JSF 2.2, it has been announced that the javax.faces.bean package may possible be deprecated in a future version. Advise is being given to use annotations from other appropriate Java EE specifications where possible (see #976).
In practice this mostly boils down to using CDI managed beans.
While those beans are a near drop-in replacement for JSF's native managed beans, one important feature is missing for them: the view scope (@ViewScoped).
This scope is not that hard to add, as shown in Steven Verborgh's article Porting the ViewScoped JSF annotation to CDI and the availability of this annotation in e.g. Seam 3.
Since the new @FlowScoped annotation requires a JSF implementation to provide a portable CDI extension that implements this scope (see #730), I wonder if we can ask the same for @ViewScoped?
Affected Versions
[2.2]
The text was updated successfully, but these errors were encountered: