This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JSF and the fly likes Is needed faces-config? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSF
Bookmark "Is needed faces-config?" Watch "Is needed faces-config?" New topic
Author

Is needed faces-config?

Alan Duke
Greenhorn

Joined: Apr 12, 2011
Posts: 26
When using java 6 and JSF 2.0, it is true that we do not need faces-config.xml?
Guy deLyonesse
Ranch Hand

Joined: Apr 12, 2011
Posts: 200

I can't imagine why you wouldn't. faces-config.xml is all of your navigation, validation, listeners and bean management.
Alan Duke
Greenhorn

Joined: Apr 12, 2011
Posts: 26
Ok, is really necessary.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17033
    
  26

In JSF2, faces-config is no longer mandatory. You can do most configuration that was formerly done in faces-config.xml using Java code annotations, and in particular, that means managed bean and managed property definitions as well as navigation.

However, there are some things that cannot be done in Java code, such as installing the bridge between the JSF EL resolver and Spring Framework's EL resolver. So in cases like that, you'd still need a faces-config.xml to hold that definition.

Like most XML configuration files that support annotation-configurable resources, if a definition appears both in Java code as an annotation and in an XML config file, the XML config file definition takes precedence. This allows you to do "management by exception" where standard components have standard interfaces, but can be overridden when the need arises.


An IDE is no substitute for an Intelligent Developer.
 
Have you checked out Aspose?
 
subject: Is needed faces-config?
 
It's not a secret anymore!