Skip to content

Commit

Permalink
#4743: Merge remote-tracking branch 'origin/2.3' into 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
BalusC committed Feb 20, 2022
1 parent e879705 commit 2fef22d
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import static com.sun.faces.config.WebConfiguration.WebContextInitParameter.ClientStateTimeout;
import static com.sun.faces.config.WebConfiguration.WebContextInitParameter.ClientStateWriteBufferSize;
import static com.sun.faces.renderkit.RenderKitUtils.PredefinedPostbackParameter.VIEW_STATE_PARAM;
import static java.util.logging.Level.WARNING;

import java.io.BufferedOutputStream;
import java.io.ByteArrayInputStream;
Expand Down Expand Up @@ -434,8 +435,16 @@ protected void init() {
String timeout = webConfig.getOptionValue(ClientStateTimeout);
try {
stateTimeout = Long.parseLong(timeout);

if (stateTimeout < 0) {
stateTimeoutEnabled = false;
}
} catch (NumberFormatException nfe) {
stateTimeout = Long.parseLong(ClientStateTimeout.getDefaultValue());
if (LOGGER.isLoggable(WARNING)) {
LOGGER.log(WARNING, ClientStateTimeout.getQualifiedName() + " context param value of '" + timeout + "' is not parseable as Long, it will be ignored");
}

stateTimeoutEnabled = false;
}
}

Expand Down

0 comments on commit 2fef22d

Please sign in to comment.