users@javaserverfaces.java.net

Re: WebConfiguration overrideContextInitParameter

From: Manfred Riem <manfred.riem_at_oracle.com>
Date: Thu, 29 Nov 2012 10:31:31 -0600

Hi Christian,

I am afraid that is the only way you can use it. The context-params
are parsed upon the initial startup of your JSF application.

Regards,
Manfred

On 11/29/2012 10:27 AM, Christian Landbo Frederiksen wrote:
> Thanks. I have that already. I want to override these in particular situations.
>
> /Chr
>
> Manfred Riem<manfred.riem_at_oracle.com> wrote:
> You need to use them by defining them as context-param
> in the web.xml file.
>
> Eg.
>
> <context-param>
> <param-name>javax.faces.PROJECT_STAGE</param-name>
> <param-value>Development</param-value>
> </context-param>
>
> Hope that helps,
> Manfred
>
> On 11/29/2012 9:24 AM, Christian Landbo Frederiksen wrote:
> Using Mojarra 2.1.13
>
> The overrideContextInitParameter does not seem to work for me.
>
> I have tried the following in ServletContextListener but the change does not take effect.
>
> @Override
> public void contextInitialized(ServletContextEvent sce) {
>
> WebConfiguration webConfig = WebConfiguration.getInstance(sce.getServletContext());
> webConfig.overrideContextInitParameter(WebContextInitParameter.JavaxFacesProjectStage, "Development");
> webConfig.overrideContextInitParameter(WebContextInitParameter.FaceletsDefaultRefreshPeriod, "1");
> webConfig.overrideContextInitParameter(WebContextInitParameter.ResourceUpdateCheckPeriod, "1");
>
> }
>
> Can somebody guide me as to how to override these settings?