Matze, I think this would all become ok if _all_ the EE6 parts will simply use the JSR-330 javax.inject.Scope annotation as basis for their scopes. This would make at least the classpath scanning part a hell lot easier (the context implementation in the background still needs to be coded for each DI part, because there is no API defined for it except in JSR-299).
I already tried to convince Gavin and Pete to at least use @Scope for JSR-299 scopes, but they refused so far. I hope that there will be a really well founded _technical_ discussion on this topic in the very near future though! My 'vision': *) JSR-330 defines the basic annotations for DI in Java generally *) JSR-299 defines the annotations for EE related stuff (@SessionScoped, RequestScoped) BASED ON JSR-330! *) JSF2 uses the @SessionScoped from JSR-299. Why should JSF define own annotations? Even if you don't like to use any 299 container, you may still use the annotations defined in the API and provide an own small DI like MyFaces does it right now. Don't know if it makes sense at all to reinvite the wheel 10000 times... ;) LieGrue, strub --- On Wed, 8/26/09, Matthias Wessendorf <[email protected]> wrote: > From: Matthias Wessendorf <[email protected]> > Subject: Re: WebBeans "eating" JSF 2.0 annotations ? > To: [email protected] > Date: Wednesday, August 26, 2009, 5:45 PM > On Wed, Aug 26, 2009 at 5:39 PM, Mark > Struberg<[email protected]> > wrote: > > In fact we (OWB) should provide standard context > implementations for JSF annotated scopes. > > > > The whole picture: > > > > .) JSF scanns the classpath for JSF annotations > > > > .) OWB scanns the classpath for JSR-299 annotations > > > > In fact, I assume (not having looked at the code) that > MyFaces provides kind of a mini DI container in the EL code. > So any EL which will get through to the faces EL handler > will successfully resolve those scoped beans > > > > Otoh, OWB also provides an EL handler which is > dominant (prior in the EL chain). OWB currently simply > ignores the javax.faces.scope annotations since they are > 'unknown' for OWB. So this very class will look like a bean > which has no annotations at all. > > > > > > The problem arises latest if JSF scoped beans need to > be injected into JSR-299 beans and vice versa... > > > > an idea how to resolve this: > > We need to provide context implementations for the > faces scopes in the webbeans-jsf module and let OWB do all > the resolving. > > > > wdyt? > > yes, that's true. It is really a PITA to have three > different ways to > @inject stuff (in JavaEE - well the javax.faces.bean.** > stuff is > optional) > > I am pretty sure this will actually cause lot's of pain, > trouble and > bad blogs on JavaEE 6 (heck, deserved! :-) ) > > Are you able to bring this dilemma up on some EG ? > (mismatch of all the stuff) > > -Matthias > > > > > LieGrue, > > strub > > > > > > --- On Wed, 8/26/09, Matthias Wessendorf <[email protected]> > wrote: > > > >> From: Matthias Wessendorf <[email protected]> > >> Subject: Re: WebBeans "eating" JSF 2.0 annotations > ? > >> To: [email protected] > >> Date: Wednesday, August 26, 2009, 5:26 PM > >> On Wed, Aug 26, 2009 at 5:23 PM, > >> Matthias Wessendorf<[email protected]> > >> wrote: > >> > On Wed, Aug 26, 2009 at 5:17 PM, Mark > Struberg<[email protected]> > >> wrote: > >> >> for what I know (discussion on wb-dev) > JSF apps > >> should use JSR-299 @ScopeType annotated scopes > (renamed to > >> @NormalScope in the latest spec) and not faces > scopes. I did > >> hope that we could unify all scopes by generally > using > >> JSR-330 javax.inject.Scope in all EE fields. But > that will > >> not work until JSR-299 also recognizes and treats > JSR-330 > >> scopes as normal scopes. > >> >> > >> > > >> > WTF ? :) > >> > > >> > It is kinda odd that JSF 2.0 has should use > the 299 > >> stuff. Standalone, > >> > ok all fine (not tested). > >> > But even if there are both in the game jsf2.0 > and 299, > >> they should > >> > just work (or at least I should > >> > get a warning that the bean is using a (good) > -sorry- > >> incorrect... annotation. > >> > > >> > Basically this is a total mess. Annontations > work > >> standalone, but not > >> > when adding some heavyweight > >> > stuff (like 299) to the game ? Oh boy... > >> > >> I am pretty sure that this will introcude a lot of > fun to > >> folks > >> writing JSF 2.0 applications, > >> if your statement is true. That would worse than > the JSP > >> 2.1 > >> dependency (with JSF 1.2) > >> > >> I filed this bug: > >> https://issues.apache.org/jira/browse/OWB-133 > >> > >> At least there should be some help. Not everybody > is > >> thrilled to > >> replace annotations based on > >> the environment (at least not me) > >> > >> > > >> > -Matthias > >> > > >> >> LieGrue, > >> >> strub > >> >> > >> >> > >> >> --- On Wed, 8/26/09, Matthias Wessendorf > <[email protected]> > >> wrote: > >> >> > >> >>> From: Matthias Wessendorf <[email protected]> > >> >>> Subject: Re: WebBeans "eating" JSF > 2.0 > >> annotations ? > >> >>> To: [email protected] > >> >>> Date: Wednesday, August 26, 2009, > 5:11 PM > >> >>> has no effect. The beast can't find > >> >>> the JSF beans. > >> >>> Due to lack of time, I am going with > JSF 2.0 > >> standalone. > >> >>> > >> >>> Question is: as it was working the > current > >> behavior is a > >> >>> regression, > >> >>> has there been any testing on OBW + > JSF 2.0 ? > >> >>> > >> >>> -Matthias > >> >>> > >> >>> On Wed, Aug 26, 2009 at 3:45 PM, > Gurkan > >> Erdogdu<[email protected]> > >> >>> wrote: > >> >>> > It must not eat. > >> >>> > > >> >>> > But one point, > >> >>> > > >> >>> > You still use old XML > configuration file > >> format. As a > >> >>> default OWB uses new > >> >>> > XML format. Add > >> >>> > https://svn.apache.org/repos/asf/incubator/openwebbeans/trunk/samples/guess/src/main/resources/META-INF/openwebbeans/openwebbeans.properties > >> >>> > > >> >>> > in your project > >> resources/META-INF/openwebbeans folder > >> >>> and sure that all > >> >>> > libraries are ok. > >> >>> > > >> >>> > You can look necessary libs > from > >> guess.war . You can > >> >>> create it from mvn > >> >>> > package -Pjetty. > >> >>> > > >> >>> > --Gurkan > >> >>> > > >> >>> > > >> >>> > 2009/8/26 Matthias Wessendorf > <[email protected]> > >> >>> > > >> >>> >> Hi, > >> >>> >> > >> >>> >> is it possible that the > current trunk > >> is _eating_ > >> >>> JSF 2.0 annotations ? > >> >>> >> > >> >>> >> <someCode> > >> >>> >> ... > >> >>> >> import > javax.faces.bean.ManagedBean; > >> >>> >> import > >> javax.faces.bean.SessionScoped; > >> >>> >> > >> >>> >> > @ManagedBean(name="playersBean") > >> >>> >> @SessionScoped > >> >>> >> public class ViewParamsBean > >> >>> >> { > >> >>> >> ... > >> >>> >> </someCode> > >> >>> >> > >> >>> >> In June (before reflecting > the > >> >>> javax.enterprise.context changes) it > was > >> >>> >> working. > >> >>> >> Now expressions like > #{playersBean} > >> are simply > >> >>> ignored ;-) > >> >>> >> > >> >>> >> Demo project is here: > >> >>> >> https://facesgoodies.googlecode.com/svn/CGN/trunk/ > >> >>> >> > >> >>> >> -Matthias > >> >>> >> > >> >>> >> > >> >>> >> -- > >> >>> >> Matthias Wessendorf > >> >>> >> > >> >>> >> blog: http://matthiaswessendorf.wordpress.com/ > >> >>> >> sessions: http://www.slideshare.net/mwessendorf > >> >>> >> twitter: http://twitter.com/mwessendorf > >> >>> >> > >> >>> > > >> >>> > > >> >>> > > >> >>> > -- > >> >>> > Gurkan Erdogdu > >> >>> > http://gurkanerdogdu.blogspot.com > >> >>> > > >> >>> > >> >>> > >> >>> > >> >>> -- > >> >>> Matthias Wessendorf > >> >>> > >> >>> blog: http://matthiaswessendorf.wordpress.com/ > >> >>> sessions: http://www.slideshare.net/mwessendorf > >> >>> twitter: http://twitter.com/mwessendorf > >> >>> > >> >> > >> >> > >> >> > >> >> > >> > > >> > > >> > > >> > -- > >> > Matthias Wessendorf > >> > > >> > blog: http://matthiaswessendorf.wordpress.com/ > >> > sessions: http://www.slideshare.net/mwessendorf > >> > twitter: http://twitter.com/mwessendorf > >> > > >> > >> > >> > >> -- > >> Matthias Wessendorf > >> > >> blog: http://matthiaswessendorf.wordpress.com/ > >> sessions: http://www.slideshare.net/mwessendorf > >> twitter: http://twitter.com/mwessendorf > >> > > > > > > > > > > > > -- > Matthias Wessendorf > > blog: http://matthiaswessendorf.wordpress.com/ > sessions: http://www.slideshare.net/mwessendorf > twitter: http://twitter.com/mwessendorf >
