[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.webtools.jsf] Re: JSF faces config file outside WEB-INF?
|
- From: Yury Kats <ykats@xxxxxxxxxx>
- Date: Wed, 02 Sep 2009 11:07:10 -0400
- Newsgroups: eclipse.webtools.jsf
- Organization: EclipseCorner
- User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 Thunderbird/1.0.6 Mnenhy/0.7.1
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.