Skip to content

Commit

Permalink
Merge pull request #5049 from eclipse-ee4j/mojarra_issue_4743
Browse files Browse the repository at this point in the history
#4743: Fix deploy fail when com.sun.faces.clientStateTimeout is invalid
  • Loading branch information
arjantijms authored Feb 20, 2022
2 parents 0aae4fe + b9e281c commit 0185dee
Showing 1 changed file with 11 additions and 2 deletions.
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 All @@ -32,6 +33,7 @@
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.io.Writer;
import java.util.Base64;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
Expand All @@ -48,7 +50,6 @@
import com.sun.faces.util.DebugUtil;
import com.sun.faces.util.FacesLogger;
import com.sun.faces.util.Util;
import java.util.Base64;

/**
* <p>
Expand Down Expand Up @@ -462,8 +463,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 0185dee

Please sign in to comment.