• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is needed faces-config?

 
Alan Duke
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When using java 6 and JSF 2.0, it is true that we do not need faces-config.xml?
 
Guy deLyonesse
Ranch Hand
Posts: 200
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't imagine why you wouldn't. faces-config.xml is all of your navigation, validation, listeners and bean management.
 
Alan Duke
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, is really necessary.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17989
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic