Package javax.faces.render

Examples of javax.faces.render.RenderKit.createResponseWriter()


            RenderKitFactory renderFactory = (RenderKitFactory)FactoryFinder.getFactory(FactoryFinder.RENDER_KIT_FACTORY);
            RenderKit renderKit = renderFactory.getRenderKit(facesContext,
                                                             facesContext.getViewRoot().getRenderKitId());

            if (isPartialStateSavingOn(facesContext)) {
                    _writer = renderKit.createResponseWriter(new _DummyPageContextOutWriter(pageContext),
                                                             null /*Default: get the allowed content-types from the accept-header*/,
                                                             pageContext.getRequest().getCharacterEncoding());
            } else {
                    _writer = renderKit.createResponseWriter(new _PageContextOutWriter(pageContext),
                                                             null /*Default: get the allowed content-types from the accept-header*/,
 
View Full Code Here


            if (isPartialStateSavingOn(facesContext)) {
                    _writer = renderKit.createResponseWriter(new _DummyPageContextOutWriter(pageContext),
                                                             null /*Default: get the allowed content-types from the accept-header*/,
                                                             pageContext.getRequest().getCharacterEncoding());
            } else {
                    _writer = renderKit.createResponseWriter(new _PageContextOutWriter(pageContext),
                                                             null /*Default: get the allowed content-types from the accept-header*/,
                                                             pageContext.getRequest().getCharacterEncoding());

            }
            facesContext.setResponseWriter(_writer);
View Full Code Here

    {
      newWriter = oldWriter.cloneWithWriter(strWriter);
    }
    else
    {
      newWriter = renderKit.createResponseWriter(strWriter, null,
                                                 renderResponse.getCharacterEncoding());
    }
    context.setResponseWriter(newWriter);

    newWriter.startDocument();
View Full Code Here

      RenderKit renderKit = renderFactory.getRenderKit(context, view.getRenderKitId());
 
      ResponseWriter responseWriter = context.getResponseWriter();
      if (responseWriter == null)
      {
          responseWriter = renderKit.createResponseWriter(externalContext.getResponseOutputWriter(), null, externalContext.getRequestCharacterEncoding());
          context.setResponseWriter(responseWriter);
      }
     
      // try to enable the ResponseSwitch again (disabled in buildView())
      Object response = context.getExternalContext().getResponse();
View Full Code Here

        RenderKit renderKit = renderFactory.getRenderKit(facesContext, viewToRender.getRenderKitId());

        ResponseWriter responseWriter = facesContext.getResponseWriter();
        if (responseWriter == null)
        {
            responseWriter = renderKit.createResponseWriter(response.getWriter(), null,
                    ((HttpServletRequest) externalContext.getRequest()).getCharacterEncoding());
            facesContext.setResponseWriter(responseWriter);
        }

        ResponseWriter oldResponseWriter = responseWriter;
View Full Code Here

        // get the encoding
        String encoding = (String) context.getAttributes().get("facelets.Encoding");

        // -= Leonardo Uribe =- Add */* to the contentType is a fix done from FaceletViewHandler
        // to make old RI versions work, but since this is for JSF 2.0 it is not necessary that code.
        ResponseWriter writer = renderKit.createResponseWriter(NullWriter.Instance, contentType, encoding);

        //ResponseWriter writer;
        // append */* to the contentType so createResponseWriter will succeed no matter
        // the requested contentType.
        //if (contentType != null && !contentType.equals("*/*"))
 
View Full Code Here

                                = _facesContext.getApplication().getViewHandler().calculateRenderKitId(_facesContext);
                        RenderKitFactory rkf
                                = (RenderKitFactory) FactoryFinder.getFactory(FactoryFinder.RENDER_KIT_FACTORY);
                        renderKit = rkf.getRenderKit(_facesContext, renderKitId);
                    }
                    responseWriter = renderKit.createResponseWriter(
                            _facesContext.getExternalContext().getResponseOutputWriter(), "text/xml",
                            _facesContext.getExternalContext().getRequestCharacterEncoding());
                }
                catch (IOException e)
                {
View Full Code Here

    {
      newWriter = oldWriter.cloneWithWriter(strWriter);
    }
    else
    {
      newWriter = renderKit.createResponseWriter(strWriter, null,
                                                 renderResponse.getCharacterEncoding());
    }
    context.setResponseWriter(newWriter);

    newWriter.startDocument();
View Full Code Here

        }
        // Create a dummy ResponseWriter with a bogus writer,
        // so we can figure out what content type the ReponseWriter
        // is really going to ask for
        try {
          writer = renderKit.createResponseWriter(
                  NullWriter.Instance, contentType, encoding);
        } catch(IllegalArgumentException e) {
          //Added because of an RI bug prior to 1.2_05-b3.  Might as well leave it in case other
          //impls have the same problem.  https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=613
          log.fine("The impl didn't correctly handled '*/*' in the content type list.  Trying '*/*' directly.");
View Full Code Here

                  NullWriter.Instance, contentType, encoding);
        } catch(IllegalArgumentException e) {
          //Added because of an RI bug prior to 1.2_05-b3.  Might as well leave it in case other
          //impls have the same problem.  https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=613
          log.fine("The impl didn't correctly handled '*/*' in the content type list.  Trying '*/*' directly.");
          writer = renderKit.createResponseWriter(
                  NullWriter.Instance, "*/*", encoding);
        }

        //Override the JSF provided content type if necessary
        contentType = getResponseContentType(context, writer.getContentType());
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.