jsr299

Why is the WebBeans (JSR-299) Conversation Context tied to JSF?

I am reading through the Public Review Draft of the Web Beans specification (JSR-299) and I am wondering why it is so 'tightly coupled' to JSF? Especially the Conversation Context seems only be specified for JSF. I understand, that it is a goal of WebBeans to integrate JSF and EJB3. But would it not make sense to specify the concept of...

Resolution of external (3rd party) beans in weld

I know it is still not quite popular, since the spec was released just a few months ago. I haven't "installed" weld yet, I'm just reading, and by this question I want to make sure I've understood this important point correct: Is resolution of beans that are in 3rd-party jars achieved by declaring them as <alternatives> in your beans.xm...

how to instantiate more then one CDI/Weld bean for one class ?

In Spring it was possible to instantiate any class by defining the corresponding bean in xml conf. It was also possible to instantiate more then one bean for the same class with different parameters..... Are the such features in CDI as well, namely is it possible to create different instances of the same class with different initializ...

How to inject beans from external libs with CDI?

How can I use JSR-299 CDI to inject (not annotated) beans from external libraries? Examples: Interface X and its implementations come from a third party lib. How can I decide which implementation to use? class A { @Inject private X x; } What if I had several classes using the X interface but different implementations? cl...

Whats the relationship between Spring and javax.enterprise.inject?

I was reading a Wikipedia article about Java EE application servers here: http://en.wikipedia.org/wiki/Java_Platform,_Enterprise_Edition#Java_EE_5_certified It says that 2 APIs that Java App Services implement are: javax.enterprise.inject javax.enterprise.context These both relate to application context and dependency injection JSR-...

Where should I declare my CDI resources?

JSR-299 (CDI) introduces the (unfortunately named) concept of a resource: http://docs.jboss.org/weld/reference/1.0.0/en-US/html/resources.html#d0e4373 You can think of a resource in this nomenclature as a bridge between the Java EE 6 brand of dependency injection (@EJB, @Resource, @PersistenceContext and the like) and CDI's brand of dep...

Can Spring understand @Inject replacing Weld as a JSR-299 implementation?

I have noticed from several web pages that apparently Spring 3.0 supports @Inject from JSR-330. As we would really like to use JSR-299 syntax for dependency injection in our libraries for both web apps and stand-alone applications, and have alternatives to Weld, it would be nice if Spring could do this. Being a novice to Spring, I trie...

Why use @PostConstruct ?

In a managed bean, @PostConstruct is called after the regular Java object constructor. Why would I use @PostConstruct to initialize by bean, instead of the regular constructor itself? ...

Useful environment for CDI / weld web-applications

I am new to weld and consider what environment is useful for a web-application using CDI (Weld). I want to use JSF or Wicket for presentation and JPA/Hibernate for my persistence layer (including Transaction-Management). The obvious scenario is to use a JBoss or Glassfish application server with EJB3 surrounding, but is there not a chanc...