Package javax.servlet.http

Examples of javax.servlet.http.HttpServletResponse.reset()


            final HttpServletResponse response = this.getResponse(context);
            final OutputStream stream = response.getOutputStream();

            // - reset the reponse to clear out any any headers (i.e. so
            //   the user doesn't get "unable to open..." when using IE.)
            response.reset();
            final String fileName = fileComponent.getFileName();
            if (fileComponent.isPrompt() && fileName != null && fileName.trim().length() > 0)
            {
                response.addHeader(
                    "Content-disposition",
View Full Code Here


*/
        // handle dev response
        if (this.developmentMode && !context.getResponseComplete()
                && resp instanceof HttpServletResponse) {
            HttpServletResponse httpResp = (HttpServletResponse) resp;
            httpResp.reset();
            httpResp.setContentType("text/html; charset=UTF-8");
            Writer w = httpResp.getWriter();
            DevTools.debugHtml(w, context, e);
            w.flush();
            context.responseComplete();
View Full Code Here

    // Call the export delegate
    ExportDelegate exportDelegate = new ExportDelegate(htmlTable, request);
    exportDelegate.prepareExport();

    response.reset();
  }

  /**
   * <p>
   * Sets up the required configuration to display the table.
View Full Code Here

                if (response instanceof HttpServletResponse)
                {
                    HttpServletResponse httpResp = (HttpServletResponse) response;
                    if (!httpResp.isCommitted())
                    {
                        httpResp.reset();
                        if (facesContext.getPartialViewContext().isAjaxRequest())
                        {   
                            // ajax request --> xml error page
                            httpResp.setContentType("text/xml; charset=UTF-8");
                            try
View Full Code Here

        parseToXML();
        FacesContext facesContext = FacesContext.getCurrentInstance();
        ExternalContext externalContext = facesContext.getExternalContext();
        HttpServletResponse response = (HttpServletResponse) externalContext.getResponse();

        response.reset();                           // Some JSF component library or some Filter might have set some headers in the buffer beforehand. We want to get rid of them, else it may collide.
        response.setContentType("application/xml"); // Check http://www.w3schools.com/media/media_mimeref.asp for all types. Use if necessary ServletContext#getMimeType() for auto-detection based on filename.
        response.setHeader("Content-disposition", "attachment; filename=" + file.getName());

        BufferedInputStream input = null;
        BufferedOutputStream output = null;
View Full Code Here

        out.close();
        
      }
      catch (Exception e)
      {
        hsr.reset();
        _LOG.warning(e);      
        FacesMessage message = MessageFactory.getMessage(context, DOWNLOAD_MESSAGE_ID);
        context.addMessage(null, message);
        context.renderResponse();
        return;
View Full Code Here

          out.close();
        
      }
      catch (Exception e)
      {
        hsr.reset();
        _LOG.warning(e);      
        FacesMessage message = MessageFactory.getMessage(context, DOWNLOAD_MESSAGE_ID);
        context.addMessage(null, message);
        context.renderResponse();
        return;
View Full Code Here

        ern.startExport(this, out, xsltfile.getAbsolutePath());
        out.flush();
        facesContext.responseComplete();
      } catch (Exception e) {
        Helper.setFehlerMeldung("Exception while exporting run note.", e.getMessage());
        response.reset();
      }

    }
    return "";
  }
View Full Code Here

        // handle dev response
        if (this.developmentMode && !context.getResponseComplete()
                && resp instanceof HttpServletResponse) {
            HttpServletResponse httpResp = (HttpServletResponse) resp;
            if (!httpResp.isCommitted()) {
              httpResp.reset();
              httpResp.setContentType("text/html; charset=UTF-8");
              Writer w = httpResp.getWriter();
              DevTools.debugHtml(w, context, e);
              w.flush();
              context.responseComplete();
View Full Code Here

            return false;
        }

        if (resetHeaders) {
            //Remove everything, including headers. The stream is often a file that may be cached.
            res.reset();
        }

        res.setHeader("Content-Encoding", HTTPSettings.lookup().getEncoding());
        if (contentDisposition != null) {
            res.setHeader("Content-Disposition", contentDisposition);
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.