3

I am working on a project which has grown bigger and lots of works still remains. The thing is, the entries in my faces-config.xml has already spanned some 600 lines, and I fear it will double up in coming months.

I was thinking if there might be some way so that I can have more than one faces-config.xml file in project, then I could have configured them according to my modules, which will ease to work with many folders.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Sushant Kumar
  • 159
  • 4
  • 14

2 Answers2

5

Yes, you can

For example you can configure your web.xml as follows and divide it.

<context-param>
    <param-name>javax.faces.CONFIG_FILES</param-name>
    <param-value>
        WEB-INF/module1/user-manage-beans.xml,
        WEB-INF/module1/user-navigation-rule.xml,
        WEB-INF/module2/patient-manage-beans.xml,
        WEB-INF/module2/patient-navigation-rule.xml
    </param-value>
</context-param>
Vasil Lukach
  • 3,658
  • 3
  • 31
  • 40
jmj
  • 237,923
  • 42
  • 401
  • 438
0

The below code will work.

<context-param>
    <param-name>javax.faces.application.CONFIG_FILES</param-name>
    <param-value>
        /WEB-INF/faces-config.xml,
        /WEB-INF/configs/customer-config.xml
    </param-value>
  </context-param>
Brian Webster
  • 30,033
  • 48
  • 152
  • 225
  • Nope. This code won't work. The context parameter name is wrong. It's the misdocumented one. And, you don't need to redefine the original `faces-config.xml`. – BalusC Dec 31 '15 at 16:33