Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The default value for com.sun.faces.clientStateTimeout is invalid #78

Open
vsvetoslavov opened this issue Sep 29, 2020 · 1 comment
Open

Comments

@vsvetoslavov
Copy link

vsvetoslavov commented Sep 29, 2020

The constructor in WebConfiguration for the ClientStateTimeout value defines the default value as "".
The init() method of ClientSideStateHelper, however, contains the following:

        stateTimeoutEnabled = webConfig.isSet(ClientStateTimeout);
        if (stateTimeoutEnabled) {
            String timeout = webConfig.getOptionValue(ClientStateTimeout);
            try {
                stateTimeout = Long.parseLong(timeout);
            } catch (NumberFormatException nfe) {
                stateTimeout = Long.parseLong(ClientStateTimeout.getDefaultValue());
            }
        }

So if the value in the web.xml is invalid, an attempt is made to read "" as Long, which in turn results in NumberFormatException.
The above behaviour is present in 2.3.9.SP03 (WildFly 18.0.0). The code for 2.3.9.SP11 seems like that as well but I haven't tested with that version.

@vsvetoslavov
Copy link
Author

Thinking further about this, and browsing through SP11 code, I notice there is practically no way to define clientStateTimeout with such a value that would set clientStateTimeoutEnabled to false. This seems incorrect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant