开发者

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

开发者 https://www.devze.com 2023-03-07 08:06 出处:网络
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 c

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 wor开发者_如何转开发k with many folders.


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>


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>
0

精彩评论

暂无评论...
验证码 换一张
取 消