users@javaserverfaces.java.net

Re: WebConfiguration overrideContextInitParameter

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

Hi Christian,

The only way you can specify these are using a context-param.
They cannot be changed at runtime.

Manfred

On 11/29/2012 10:34 AM, Christian Landbo Frederiksen wrote:
> What is the override method for then?
>
> Manfred Riem<manfred.riem_at_oracle.com> wrote:
> 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