PPR confused about content types
--------------------------------

                 Key: TRINIDAD-1448
                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1448
             Project: MyFaces Trinidad
          Issue Type: Bug
    Affects Versions:  1.2.11-core
            Reporter: Stephane Epardaud


Something is wrong in PPR:

# My browser sends an AJAX (PPR) request accepting text/html first
# CoreRenderKit.createResponseWriter() calls _chooseContentType() which selects 
HTML
# An HtmlResponseWriter is created
# Since it is a PPR, the HtmlResponseWriter is wrapped inside a 
PPRResponseWriter
# The PPRResponseWriter and XmlHttpServletResponse serve what they pretend is 
an XML (text/xml) document
# The view rendering uses the HtmlResponseWriter to render HTML inside that PPR 
XML document (this is already wrong since HTML cannot be inserted in XML)
# The HtmlResponseWriter uses HTMLEscapes to replace perfectly valid UTF-8 
chars such as #uA0 (no-break space) by   which is NOT VALID in XML
# The browser fails to load this invalid XML document as it contains HTML in 
some places
# The PPR request fails

Now, I am not sure how to patch this since it is not obvious whether the 
response should be forced to really be XML and thus use XhtmlResponseWriter and 
just bypass the mime type selection, or whether *since we are serving HTML as 
selected by the client* the PPRResponseWriter should serve HTML.

If you don't have the time to fix this, please can you guide me so I can send a 
proper patch since I need this ASAP and will patch it any way works for us ;)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to