Hi Gerhard, thanks for the explanation. Yep, makes sense. Do you have a mail archive where I can read your past discussion about it? When working with JPA, is your CDI bean a dto?
Regards, Chris -------- Original-Nachricht -------- > Datum: Tue, 26 Jul 2011 16:43:44 +0200 > Von: Gerhard Petracek <[email protected]> > An: MyFaces Discussion <[email protected]> > Betreff: Re: JSF and CDi > hi chris, > > first of all: welcome @ myfaces! > > what you saw is (imo) a "side-effect" if you have a beans.xml in your > webapp-module. weld finds the classes but with "unknown" or no annotations > and you get dependent scoped beans (because it's the default scope in > cdi). > that would be the same with openwebbeans (the cdi implementation hosted at > apache) however, several portable cdi extensions like codi (codi is no cdi > implementation) provide a scope adapter. that means: even if you use jsf2 > annotations for scopes, the beans will end up as cdi beans (with the > corresponding cdi scope). > > there were a lot of discussions about this topic. in the end everybody > agreed on not using the bean management facility of jsf >if< you can use > cdi > (or any other modern dependency injection container), because there is > just > no benefit in using a container which offers less functionality and you > just > get more disadvantages. > > regards, > gerhard > > http://www.irian.at > > Your JSF powerhouse - > JSF Consulting, Development and > Courses in English and German > > Professional Support for Apache MyFaces > > > > 2011/7/26 Christian Rosche <[email protected]> > > > Hi all, > > > > I am not sure whether this is the right place to ask. > > > > I am creating a webapp with MyFaces and CODI. I would like to store all > ui > > related beans in the faces-config. All services should be managed by > CDI. > > > > I konw that JSF 2 can understand the @Named annotation, but I would like > to > > have just JSF at this place. > > > > My question: > > Is it possible to inject CDI beans into faces managed beans? I did a > test > > with Weld, and it did work. But I am unsure, if this was planned or if > it is > > just working but nobody knows why. > > > > Regards, > > Chris > > > > -- > > NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie! > > Jetzt informieren: http://www.gmx.net/de/go/freephone > > -- Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de

