Skip to content

Commit

Permalink
Merge pull request #5240 from eclipse-ee4j/mojarra_issue_5189
Browse files Browse the repository at this point in the history
Don't attempt to reconfigure PartialResponseWriter when it's already committed
  • Loading branch information
arjantijms authored Jun 28, 2023
2 parents 991b9f3 + 9426764 commit ff2bce8
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import static com.sun.faces.renderkit.RenderKitUtils.PredefinedPostbackParameter.PARTIAL_RENDER_PARAM;
import static com.sun.faces.renderkit.RenderKitUtils.PredefinedPostbackParameter.PARTIAL_RESET_VALUES_PARAM;
import static java.util.logging.Level.FINE;
import static java.util.logging.Level.WARNING;
import static javax.faces.FactoryFinder.VISIT_CONTEXT_FACTORY;

import java.io.IOException;
Expand Down Expand Up @@ -672,9 +673,15 @@ public DelayedInitPartialResponseWriter(PartialViewContextImpl ctx) {
super(null);
this.ctx = ctx;
ExternalContext extCtx = ctx.ctx.getExternalContext();
extCtx.setResponseContentType(RIConstants.TEXT_XML_CONTENT_TYPE);
extCtx.setResponseCharacterEncoding(extCtx.getRequestCharacterEncoding());
extCtx.setResponseBufferSize(ctx.ctx.getExternalContext().getResponseBufferSize());

if (extCtx.isResponseCommitted()) {
LOGGER.log(WARNING, "Response is already committed - cannot reconfigure it anymore");
}
else {
extCtx.setResponseContentType(RIConstants.TEXT_XML_CONTENT_TYPE);
extCtx.setResponseCharacterEncoding(extCtx.getRequestCharacterEncoding());
extCtx.setResponseBufferSize(extCtx.getResponseBufferSize());
}
}


Expand Down

0 comments on commit ff2bce8

Please sign in to comment.