This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Simple CDI and JSF2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Simple CDI and JSF2 " Watch "Simple CDI and JSF2 " New topic

Simple CDI and JSF2

Logan Lee

Joined: Oct 28, 2009
Posts: 18

Hi Guys,

I'm looking into the new JEE6 features. I'm want to use CDI to display some dynamic list of books on a JSF2 page. But I can't see the list.
The page only displays the static string: "This is a list of the top selling books"

It seems the BookManager is not accessed. What do I need to add?


This is my books.xhtml file:

And a manager bean:
Logan Lee

Joined: Oct 28, 2009
Posts: 18

mmmkay it's working now! Apparently a missing beans.xml was the problem.

I didn't put the beans.xml file in the WEB-INF. (or META-INF) directory.
The beans.xml file is empty but it is a required artifact. This file is used to enable CDI services.

No error messages in Jboss console....
It is sorta covered in the JavaRanch Style Guide.
subject: Simple CDI and JSF2
Similar Threads
need help to resolve unexpected XML tag expected:.......
An Error Occurred: javax/persistence/Persistence
commandLink not working in datatable+jsf2.0
dataTable (JSF 2.0) - fetching two times
Confused. How do I add links to each item in a list, how to get JSF to know which link was clicked?