Package org.apache.myfaces.shared.renderkit.html

Examples of org.apache.myfaces.shared.renderkit.html.HtmlResponseWriterImpl


        MyfacesConfig config = new MyfacesConfig();
        facesContext.getExternalContext().getApplicationMap().put(MyfacesConfig.class.getName(), config);
        request.addHeader("Accept", "application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"); //Webkit
        HtmlRenderKitImpl renderKit = new HtmlRenderKitImpl();
        StringWriter writer = new StringWriter();
        HtmlResponseWriterImpl responseWriter = (HtmlResponseWriterImpl) renderKit.createResponseWriter(writer, null, null);
        Assert.assertEquals(ContentTypeUtils.HTML_CONTENT_TYPE, responseWriter.getContentType());
        Assert.assertEquals(ContentTypeUtils.HTML_CONTENT_TYPE, responseWriter.getWriterContentTypeMode());
    }
View Full Code Here


        MyfacesConfig config = new MyfacesConfig();
        facesContext.getExternalContext().getApplicationMap().put(MyfacesConfig.class.getName(), config);
        request.addHeader("Accept", "image/png"); //Webkit
        HtmlRenderKitImpl renderKit = new HtmlRenderKitImpl();
        StringWriter writer = new StringWriter();
        HtmlResponseWriterImpl responseWriter = (HtmlResponseWriterImpl) renderKit.createResponseWriter(writer, null, null);
    }
View Full Code Here

        facesContext.getExternalContext().getApplicationMap().put(MyfacesConfig.class.getName(), config);
        request.addHeader("Accept", "image/jpeg, application/x-ms-application, image/gif, application/xaml+xml, " +
            "image/pjpeg, application/x-ms-xbap, application/x-shockwave-flash, application/msword, */*"); //IE8
        HtmlRenderKitImpl renderKit = new HtmlRenderKitImpl();
        StringWriter writer = new StringWriter();
        HtmlResponseWriterImpl responseWriter = (HtmlResponseWriterImpl) renderKit.createResponseWriter(writer, null, null);
        Assert.assertEquals(ContentTypeUtils.HTML_CONTENT_TYPE, responseWriter.getContentType());
        Assert.assertEquals(ContentTypeUtils.HTML_CONTENT_TYPE, responseWriter.getWriterContentTypeMode());
    }
View Full Code Here

        facesContext.getExternalContext().getApplicationMap().put(MyfacesConfig.class.getName(), config);
        request.addHeader("Accept", "text/html, application/xml;q=0.9, application/xhtml+xml;q=0.9, image/png, " +
            "image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1"); //Opera
        HtmlRenderKitImpl renderKit = new HtmlRenderKitImpl();
        StringWriter writer = new StringWriter();
        HtmlResponseWriterImpl responseWriter = (HtmlResponseWriterImpl) renderKit.createResponseWriter(writer, null, null);
        Assert.assertEquals(ContentTypeUtils.HTML_CONTENT_TYPE, responseWriter.getContentType());
        Assert.assertEquals(ContentTypeUtils.HTML_CONTENT_TYPE, responseWriter.getWriterContentTypeMode());
    }
View Full Code Here

                "application/x-silverlight-2-b2, application/x-silverlight,"+
                "application/vnd.ms-excel, application/vnd.ms-powerpoint,"+
                "application/msword, */*"); //IE
        HtmlRenderKitImpl renderKit = new HtmlRenderKitImpl();
        StringWriter writer = new StringWriter();
        HtmlResponseWriterImpl responseWriter = (HtmlResponseWriterImpl) renderKit.createResponseWriter(writer, null, null);
        Assert.assertEquals(ContentTypeUtils.HTML_CONTENT_TYPE, responseWriter.getContentType());
        Assert.assertEquals(ContentTypeUtils.HTML_CONTENT_TYPE, responseWriter.getWriterContentTypeMode());
    }
View Full Code Here

                            httpResp.setContentType("text/xml; charset=UTF-8");
                            try
                            {
                                Writer writer = httpResp.getWriter();
                                // can't use facesContext.getResponseWriter(), because it might not have been set
                                ResponseWriter responseWriter = new HtmlResponseWriterImpl(writer, "text/xml", "utf-8");
                                PartialResponseWriter partialWriter = new PartialResponseWriter(responseWriter);
                                partialWriter.startDocument();
                                partialWriter.startError(ex.getClass().getName());
                                if (ex.getCause() != null)
                                {
View Full Code Here

        //root.setViewId("viewMetadata.xhtml");
        vdl.buildView(facesContext, root, "viewMetadata.xhtml");
        facesContext.setViewRoot(root);
       
        StringWriter sw = new StringWriter();
        ResponseWriter mrw = new HtmlResponseWriterImpl(sw,"text/html","UTF-8");
        facesContext.setResponseWriter(mrw);
       
        root.encodeAll(facesContext);
        sw.flush();
        System.out.print(sw.toString());
View Full Code Here

        //root.setViewId("viewMetadata.xhtml");
        vdl.buildView(facesContext, root, "viewMetadata.xhtml");
        facesContext.setViewRoot(root);
       
        StringWriter sw = new StringWriter();
        ResponseWriter mrw = new HtmlResponseWriterImpl(sw,"text/html","UTF-8");
        facesContext.setResponseWriter(mrw);
       
        root.encodeAll(facesContext);
        sw.flush();
        System.out.print(sw.toString());
View Full Code Here

    @Override
    protected void setUpJSFObjects() throws Exception
    {
        super.setUpJSFObjects();
        outputWriter = new FastWriter();
        writer = new HtmlResponseWriterImpl(outputWriter, null, null);
        facesContext.setResponseWriter(writer);
        facesContext.getAttributes().put("org.apache.myfaces.RENDERED_JSF_JS", true);
    }
View Full Code Here

    @Override
    protected void setUpJSFObjects() throws Exception
    {
        super.setUpJSFObjects();
        outputWriter = new FastWriter();
        writer = new HtmlResponseWriterImpl(outputWriter, null, null);
        facesContext.setResponseWriter(writer);
        facesContext.getAttributes().put("org.apache.myfaces.RENDERED_JSF_JS", true);
    }
View Full Code Here

TOP

Related Classes of org.apache.myfaces.shared.renderkit.html.HtmlResponseWriterImpl

Copyright © 2018 www.massapicom. 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.