JSF faces config file outside WEB-INF?

前端 未结 3 643
执念已碎
执念已碎 2021-01-12 19:20

When creating multiple faces config files, it is correct to have the faces-config.xml outside of WEB-INF? The JSF spec does not seem to be very clear about this (Section 10.

3条回答
  •  星月不相逢
    2021-01-12 20:23

    It is possible, but not recommended. The reason you put configuration files under WEB-INF is that the server knows not to serve these files - you have your code, database configuration and other sensitive stuff there.

    You cannot use "/WebContent/WEB-INF/faces-config2.xml" - AFAIK "WebContent" is eclipse specific. have the config files names to be absolute inside the WAR. It means that they will always begin with "/WEB-INF/".

提交回复
热议问题