my dog learned polymorphism*
The moose likes JSF and the fly likes @ManagedBean vs @Named Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "@ManagedBean vs @Named" Watch "@ManagedBean vs @Named" New topic
Author

@ManagedBean vs @Named

Marcin Kwiatkowski
Ranch Hand

Joined: Aug 06, 2007
Posts: 32

There seems to be ongoing discussion on which annotation should be used. What's your take on that?
Jason Porter
Ranch Hand

Joined: Apr 26, 2007
Posts: 120
As you've said, there's been a lot of talk. It appears that pretty much everyone is suggesting @Name. The @ManagedBean (from JSF) really doesn't offer anything that @Name does not. It wouldn't surprise ms if @ManagedBean becomes deprecated in JSF2.1 in favor of CDI.
Ed Burns
author
Ranch Hand

Joined: Sep 11, 2006
Posts: 82
    
    5
Jason Porter wrote:As you've said, there's been a lot of talk. It appears that pretty much everyone is suggesting @Name. The @ManagedBean (from JSF) really doesn't offer anything that @Name does not. It wouldn't surprise ms if @ManagedBean becomes deprecated in JSF2.1 in favor of CDI.


The presence of javax.faces.bean http://java.sun.com/javaee/6/docs/api/javax/faces/bean/package-summary.html in JSF 2 is only to enable those that use JSF2 on top of a Servlet 2.5 container to still have access to the features that obviate the need for the faces-config.xml.

If you're on an EE6 container, such as Oracle Glassfish, you'll be better served by using @Named.

Ed
Marcin Kwiatkowski
Ranch Hand

Joined: Aug 06, 2007
Posts: 32

Sounds good. Thanks for the answer!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: @ManagedBean vs @Named