Sushant Kumar
Sushant Kumar

Reputation: 169

Can we have multiple faces-config.xml files in our JSF application?

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.

Upvotes: 3

Views: 4692

Answers (2)

Jigar Joshi
Jigar Joshi

Reputation: 240996

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>

Upvotes: 5

venkatakrishna M
venkatakrishna M

Reputation: 9

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>

Upvotes: 0

Related Questions