[jboss-user] [JBoss Portal] - Re: http://jira.jboss.com/jira/browse/JBPORTAL-459 You shoul

swestbom do-not-reply at jboss.com
Fri May 18 13:44:15 EDT 2007


BTW what is with jsf-example.jar containing the Facelet bridge class.

Also replace the method in the class with this one so it works within and outside the portal.

  protected ResponseWriter createResponseWriter(FacesContext context)
        throws IOException, FacesException
    {
        ExternalContext extContext = context.getExternalContext();
        if(extContext.getRequest() instanceof ServletRequest)
            return super.createResponseWriter(context);
        RenderKit renderKit = context.getRenderKit();
        RenderRequest request = (RenderRequest)extContext.getRequest();
        RenderResponse response = (RenderResponse)extContext.getResponse();
        String contenttype = request.getResponseContentType();
        if(contenttype == null)
            contenttype = "text/html";
        String encoding = response.getCharacterEncoding();
        if(encoding == null)
            encoding = "ISO-8859-1";
        ResponseWriter writer = renderKit.createResponseWriter(FaceletViewHandler.NullWriter.Instance, contenttype, encoding);
        contenttype = writer.getContentType();
        response.setContentType(contenttype);
        writer = writer.cloneWithWriter(response.getWriter());
        return writer;
    }


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4046895#4046895

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4046895



More information about the jboss-user mailing list