CDI: beans.xml, where do I put you?

For EJB and JAR packaging you should place the beans.xml in src/main/resources/META-INF/. For WAR packaging you should place the beans.xml in src/main/webapp/WEB-INF/. Remember that only .java files should be put in the src/main/java and src/test/java directories. Resources like .xml files should be in src/main/resources.

Are @ManagedBeans obsolete in JavaEE6 because of @Named in CDI/Weld?

In short, @ManagedBean makes sense for applications that use JSF but do not use JSR 299 (whatever the reason is). Below a longer explanation from Gavin King: Re: Comparisons to @ManagedBean annotations in JSF2?: While looking through the Weld examples, and the older WebBeans documentation, it looks like a competitor to the new @ManagedBean JSF … Read more

How to create a modular JSF 2.0 application?

I understand that your question basically boils down to How can I include Facelets views in a JAR? You can do this by placing a custom ResourceResolver in the JAR. public class FaceletsResourceResolver extends ResourceResolver { private ResourceResolver parent; private String basePath; public FaceletsResourceResolver(ResourceResolver parent) { this.parent = parent; this.basePath = “/META-INF/resources”; // TODO: Make … Read more

tech