Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JavaServer Faces » JSF faces config file outside WEB-INF?
JSF faces config file outside WEB-INF? [message #483545] Wed, 02 September 2009 01:48 Go to next message
Debajit Adhikary is currently offline Debajit AdhikaryFriend
Messages: 8
Registered: July 2009
Junior Member
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 15:07 Go to previous message
Yury Kats is currently offline Yury KatsFriend
Messages: 104
Registered: July 2009
Senior Member
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.
Previous Topic:JSF config file outside WEB-INF?
Next Topic:JSF faces config file outside WEB-INF?
Goto Forum:
  


Current Time: Fri Apr 19 07:31:05 GMT 2024

Powered by FUDForum. Page generated in 0.01960 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top