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

Fix failing spec1135IT since https://github.com/eclipse-ee4j/mojarra/issues/5164 #1719

Merged
merged 1 commit into from
Nov 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import java.io.IOException;

import jakarta.enterprise.context.RequestScoped;
import jakarta.faces.annotation.FacesConfig;
import jakarta.faces.context.ExternalContext;
import jakarta.faces.context.FacesContext;
import jakarta.faces.event.ComponentSystemEvent;
import jakarta.inject.Inject;
import jakarta.inject.Named;
Expand All @@ -30,18 +30,22 @@
@RequestScoped
public class PostRenderViewEventBean {

@Inject
private FacesContext facesContext;

@Inject
private ExternalContext externalContext;

public void pre(ComponentSystemEvent event) throws IOException {
externalContext.getResponseOutputWriter().write("<!-- pre -->");
facesContext.setResponseWriter(facesContext.getRenderKit().createResponseWriter(externalContext.getResponseOutputWriter(), "text/html", "UTF-8"));
facesContext.getResponseWriter().write("<!-- pre -->");
}

public String getRender() {
return "render";
}

public void post(ComponentSystemEvent event) throws IOException {
externalContext.getResponseOutputWriter().write("<!-- post -->");
facesContext.getResponseWriter().write("<!-- post -->");
}
}