eclipse-ee4j / mojarra

Mojarra, a Jakarta Faces implementation
Other
158 stars 108 forks source link

Context param 'jakarta.faces.NUMBER_OF_CLIENT_WINDOWS' ignored. #5291

Closed jezovuk closed 10 months ago

jezovuk commented 11 months ago

Describe the bug

It seems that context param jakarta.faces.NUMBER_OF_CLIENT_WINDOWS is ignored and max number of client windows always (silently) defaults to 10.

To Reproduce

Add following in web.xml:

<context-param>
    <param-name>jakarta.faces.NUMBER_OF_CLIENT_WINDOWS</param-name>
    <param-value>3</param-value>
 </context-param>

Expected behavior

Number of client windows is expected to be limited to configured value 3 (for above case). It is expected that least-recently-used windows get 'forgotten' once windows after 3rd are opened.

Instead, window scoped beans get forgotten/dropped only after 10th window is opened. Debugging confirms that limit config is ignored and hard-coded value 10 is used instead.

Additional context

From cursory glance, it seems that com.sun.faces.config.WebConfiguration.WebContextInitParameter enum is missing the member for jakarta.faces.NUMBER_OF_CLIENT_WINDOWS.

Observed with Mojarra 4.0.2 on Adoptium Temurin JDK 17.0.6 (desktop Firefox 115.0.2 on Windows 10).

BalusC commented 11 months ago

Confirmed. The impl was not correctly done in 20f8727b25132d8046dbd21c2d8128b9225ea986. It consulted the session map instead of context param.

BalusC commented 10 months ago

4.0.4 has been released with the fix.