Examples of responseReset()


Examples of javax.faces.context.ExternalContext.responseReset()

        boolean isDevelopment = ctx.isProjectStage(ProjectStage.Development);
        ExternalContext extContext = ctx.getExternalContext();
        Throwable wrapped = fe.getCause();
        try {
            extContext.responseReset();
        } catch (Exception e) {
            if (LOGGER.isLoggable(Level.INFO)) {
                LOGGER.log(Level.INFO, "Exception when handling error trying to reset the response.", wrapped);
            }
        }
View Full Code Here

Examples of javax.faces.context.ExternalContext.responseReset()

        boolean isDevelopment = ctx.isProjectStage(ProjectStage.Development);
        ExternalContext extContext = ctx.getExternalContext();
        Throwable wrapped = fe.getCause();
        try {
            extContext.responseReset();
        } catch (Exception e) {
            if (LOGGER.isLoggable(Level.INFO)) {
                LOGGER.log(Level.INFO, "Exception when handling error trying to reset the response.", wrapped);
            }
        }
View Full Code Here

Examples of javax.faces.context.ExternalContext.responseReset()

        boolean responseResetted = false;

        if (context.getCurrentPhaseId().equals(PhaseId.RENDER_RESPONSE)) {
            if (!externalContext.isResponseCommitted()) {
                String characterEncoding = externalContext.getResponseCharacterEncoding();
                externalContext.responseReset();
                externalContext.setResponseCharacterEncoding(characterEncoding);

                responseResetted = true;
            }
        }
View Full Code Here

Examples of javax.faces.context.ExternalContext.responseReset()

    public void exportPdf() throws IOException {
        FacesContext fc = FacesContext.getCurrentInstance();
        ExternalContext ec = fc.getExternalContext();

        ec.responseReset();
        ec.setResponseContentType("application/pdf"); // Check http://www.iana.org/assignments/media-types for all types. Use if necessary ExternalContext#getMimeType() for auto-detection based on filename.
        ec.setResponseHeader("Content-Disposition", "attachment; filename=\"" + UUID.randomUUID().toString() + ".pdf\""); // The Save As popup magic is done here. You can give it any file name you want, this only won't work in MSIE, it will use current request URL as file name instead.

        OutputStream output = ec.getResponseOutputStream();
        formData = null;
View Full Code Here

Examples of javax.faces.context.ExternalContext.responseReset()

        boolean isDevelopment = ctx.isProjectStage(ProjectStage.Development);
        ExternalContext extContext = ctx.getExternalContext();
        Throwable wrapped = fe.getCause();
        try {
            extContext.responseReset();
        } catch (Exception e) {
            if (LOGGER.isLoggable(Level.INFO)) {
                LOGGER.log(Level.INFO, "Exception when handling error trying to reset the response.", wrapped);
            }
        }
View Full Code Here

Examples of javax.faces.context.ExternalContext.responseReset()

  private void resetResponse(FacesContext context) {
    ExternalContext externalContext = context.getExternalContext();
    String contentType = externalContext.getResponseContentType(); // Remember content type.
    String characterEncoding = externalContext.getResponseCharacterEncoding(); // Remember encoding.
    externalContext.responseReset();
    OmniPartialViewContext.getCurrentInstance(context).resetPartialResponse();
    externalContext.setResponseContentType(contentType);
    externalContext.setResponseCharacterEncoding(characterEncoding);
  }
View Full Code Here

Examples of javax.faces.context.ExternalContext.responseReset()

    public static  void renderHtmlErrorPage(FacesContext ctx, FacesException fe) {

        ExternalContext extContext = ctx.getExternalContext();
        if (!extContext.isResponseCommitted()) {
            extContext.responseReset();
            extContext.setResponseContentType("text/html; charset=UTF-8");
            extContext.setResponseStatus(500);
            try {
                Writer w = extContext.getResponseOutputWriter();
                DevTools.debugHtml(w, ctx, fe.getCause());
View Full Code Here

Examples of javax.faces.context.ExternalContext.responseReset()

        boolean isDevelopment = ctx.isProjectStage(ProjectStage.Development);
        ExternalContext extContext = ctx.getExternalContext();
        Throwable wrapped = fe.getCause();
        try {
            extContext.responseReset();
        } catch (Exception e) {
            if (LOGGER.isLoggable(Level.INFO)) {
                LOGGER.log(Level.INFO, "Exception when handling error trying to reset the response.", wrapped);
            }
        }
View Full Code Here

Examples of javax.faces.context.ExternalContext.responseReset()

    public static  void renderHtmlErrorPage(FacesContext ctx, FacesException fe) {

        ExternalContext extContext = ctx.getExternalContext();
        if (!extContext.isResponseCommitted()) {
            extContext.responseReset();
            extContext.setResponseContentType("text/html; charset=UTF-8");
            extContext.setResponseStatus(500);
            try {
                Writer w = extContext.getResponseOutputWriter();
                DevTools.debugHtml(w, ctx, fe.getCause());
View Full Code Here

Examples of javax.faces.context.ExternalContext.responseReset()

    public static  void renderHtmlErrorPage(FacesContext ctx, FacesException fe) {

        ExternalContext extContext = ctx.getExternalContext();
        if (!extContext.isResponseCommitted()) {
            extContext.responseReset();
            extContext.setResponseContentType("text/html; charset=UTF-8");
            extContext.setResponseStatus(500);
            try {
                Writer w = extContext.getResponseOutputWriter();
                DevTools.debugHtml(w, ctx, fe.getCause());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.