webtier@glassfish.java.net

[webtier] _at_javax.faces.bean.ManagedBean or _at_javax.inject.Named ?

From: Celinio Fernandes <papouasied_at_yahoo.com>
Date: Tue, 5 Jan 2010 13:24:05 -0800 (PST)

Hi,

I have a question about the way we now declare managed beans in JSF 2.
Which annotation should we use at the class level :

@javax.faces.bean.ManagedBean  or  @javax.inject.Named  ?

With CDI (JSR 299) now available in Java EE 6, I am not sure which one to use when creating managed beans for JSF.

What do you recommend and why ?

Thanks for your feedback.