JSF faces config file outside WEB-INF? [message #483545] |
Tue, 01 September 2009 21:48  |
Eclipse User |
|
|
|
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.1.3)
If yes, how should this faces-config.xml be declared in web.xml? the paths generated by IDE's (like Eclipse/JDev) generally use something like:
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config1.xml</param-value>
</context-param>
Now, if my faces-config.xml is outside WEB-INF -- is it correct to declare the param-value as something like "/WebContent/WEB-INF/faces-config2.xml"?
|
|
|
Re: JSF faces config file outside WEB-INF? [message #483685 is a reply to message #483545] |
Wed, 02 September 2009 11:07  |
Eclipse User |
|
|
|
On 9/1/2009 9:48 PM, Debajit Adhikary wrote:
> 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.1.3)
>
> If yes, how should this faces-config.xml be declared in web.xml? the paths generated by IDE's (like Eclipse/JDev) generally use something like:
>
> <context-param>
> <param-name>javax.faces.CONFIG_FILES</param-name>
> <param-value>/WEB-INF/faces-config1.xml</param-value>
> </context-param>
>
> Now, if my faces-config.xml is outside WEB-INF -- is it correct to declare the param-value as something like "/WebContent/WEB-INF/faces-config2.xml"?
You can have the file anywhere inside your application's context root (e.g. /WebContent), I believe.
The main benefit of putting config files in WEB-INF folder is that the folder is by default protected by the server
in that it's not accessible by users. If you put the file into /WebContent/folder, then a user can enter the path
in the browser and take a look at your configuration file.
If your file was in /WebContent/folder, then the param value would be /folder/faces-config2.xml,
assuming /WebContent is your application's context root.
|
|
|
Powered by
FUDForum. Page generated in 0.05071 seconds