[ 
https://issues.apache.org/jira/browse/MYFACES-3543?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Leonardo Uribe resolved MYFACES-3543.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.1.8
                   2.0.14
         Assignee: Leonardo Uribe

I checked the problem and it is a bit tricky to understand. In this case, the 
response writer is created passing "text/xml" content type directly from the 
java code which calls createResponseWriter. Since it is not null, the algorithm 
to derive the content type in HtmlRenderKit fails, because it takes into 
account that one, but it should not, because it is an ajax request, and the 
partial response writer wraps the response writer provided by the renderkit. 
So, in this case we have that the final content type is "text/xml", but the 
content type for HtmlResponseWriter should be the default "text/html" or any 
other defined by the web config param 
org.apache.myfaces.DEFAULT_RESPONSE_WRITER_CONTENT_TYPE_MODE (introduced in 
MYFACES-3412)

The solution is before throw the exception check if it is an ajax request and 
if that so and contentTypeListStringFromAccept == null then use the default, 
otherwise throw the exception as expected. The spec is vague in this part, but 
I suppose in this case it is justified the change.


                
> java.lang.IllegalArgumentException: text/xml on ajax requests with webkit 
> mobile browser 
> -----------------------------------------------------------------------------------------
>
>                 Key: MYFACES-3543
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3543
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 2.1.7
>            Reporter: Marcus Büttner
>            Assignee: Leonardo Uribe
>             Fix For: 2.0.14, 2.1.8
>
>
> Mobile webkit browser doesn't send an accept header on ajax requests.
> java.lang.IllegalArgumentException:   text/xml
> at 
> org.apache.myfaces.renderkit.html.HtmlRenderKitImpl.createResponseWriter(HtmlRenderKitImpl.java:299)
> at 
> org.apache.myfaces.extensions.cdi.jsf2.impl.scope.conversation.InterceptedRenderKit.createResponseWriter(InterceptedRenderKit.java:56)
> at 
> org.apache.myfaces.context.servlet.PartialViewContextImpl.getPartialResponseWriter(PartialViewContextImpl.java:344)
> at 
> org.primefaces.context.PrimePartialViewContext.getPartialResponseWriter(PrimePartialViewContext.java:50)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to