[ 
https://issues.apache.org/jira/browse/MYFACES-4608?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17735794#comment-17735794
 ] 

Paul Nicolucci commented on MYFACES-4608:
-----------------------------------------

The spec doesn't mention what to do if the ProjectStage is Development:

[https://jakarta.ee/specifications/faces/4.0/apidocs/jakarta/faces/application/viewhandler#FACELETS_REFRESH_PERIOD_PARAM_NAME]

It does however list a default for Production if the parameter isn't specified: 
"If ProjectStage is set to Production and this value is not otherwise 
specified, the runtime must act as if it is set to -1."

The application looks to have been explicitly setting the parameter to "-1" in 
the web.xml: 
[https://github.com/gesker/sub-module-reload-page-fail-demonstrator/blob/main/www/src/main/resources/META-INF/web.xml#L60],
 so even if we changed our Default in Development it would not have mattered 
unless we always ignore the specified parameter when ProjectStage is set to 
Development which would not be obvious to a user.

Mojarra looks to use the parameter specified, if not specified, and in 
Production it uses "-1" otherwise it uses a default value of "2" it looks:
1) 
[https://github.com/eclipse-ee4j/mojarra/blob/8fe7baef662c7b8be28b80e3506b7c7a5b8cd0ce/impl/src/main/java/com/sun/faces/application/ApplicationAssociate.java#L625]
2) 
[https://github.com/eclipse-ee4j/mojarra/blob/master/impl/src/main/java/com/sun/faces/config/WebConfiguration.java#L767]

Myfaces:

1) 
[https://github.com/apache/myfaces/blob/main/api/src/main/java/jakarta/faces/application/ViewHandler.java#L125]
 looks to always default to "-1"

I agree with Vlad, that a specification issue is a good path forward. It would 
allow us to discuss at the spec level and ensure consistent implementation.

I'd propose we offer the following: "If ProjectStage is Development and the 
parameter is not explicitly set, the default value should be 0."

> FACELETS_REFRESH_PERIOD Settings
> --------------------------------
>
>                 Key: MYFACES-4608
>                 URL: https://issues.apache.org/jira/browse/MYFACES-4608
>             Project: MyFaces Core
>          Issue Type: New Feature
>          Components: General
>    Affects Versions: 2.3.10, 3.0.2, 2.3-next-M8, 4.0.1
>            Reporter: Melloware
>            Priority: Major
>
> Original issue came up in Quarkus conversation: 
> [https://github.com/quarkiverse/quarkus-primefaces/issues/75]
> User had this setting in web.xml and was wondering why he could not hot 
> reload pages in DEV Mode
> {code:java}
>     <context-param>
>         <param-name>jakarta.faces.FACELETS_REFRESH_PERIOD</param-name>
>         <param-value>-1</param-value>
>     </context-param> 
> {code}
> Question for the team based on what Mojarra is doing.
>  # In PRODUCTION mode should we force it to -1 and ignore the user setting 
> like Mojarra does?
>  # If the value is not a positive number in DEV mode should we ignore it or 
> log a warning?
>  
> Any other ideas?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to