[
https://issues.apache.org/jira/browse/MYFACES-3174?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Leonardo Uribe resolved MYFACES-3174.
-------------------------------------
Resolution: Invalid
Assignee: Leonardo Uribe
I have checked it and the hack done by this component is invalid from spec
point of view.
The problem is JSF default ResponseWriter only handles html and xhtml, so it
only accepts the following:
text/html
text/*
*/*
application/xhtml+xml
application/xml
text/xml
It is not surprising it does not accept text/css, because the default
ResponseWriter doesn't know how to handle such type. There are two options:
1. pass as second parameter for
RenderKit.createResponseWriter(Writer writer, String contentTypeListString,
String characterEncoding)
*/*, to ignore Accept header.
2. create a custom ResponseWriter for that content type and use it in a custom
RenderKit.
see JSF 2.0 spec section 8.1:
"... The contentTypeList parameter is an "Accept header style" list of content
types for this response, or null if the RenderKit should choose the best fit.
[P1-start-contentTypeList]The RenderKit must support a value for the
contentTypeList argument that comes straight from the Accept HTTP header, and
therefore requires parsing according to the specification of the Accept ..."
I'll close this one as invalid.
> IE9 css loading leads to java.lang.IllegalArgumentException: ContentTypeList
> does not contain a supported content type: text/css
> --------------------------------------------------------------------------------------------------------------------------------
>
> Key: MYFACES-3174
> URL: https://issues.apache.org/jira/browse/MYFACES-3174
> Project: MyFaces Core
> Issue Type: Bug
> Affects Versions: 1.2.10
> Environment: Tomcat 6.0.32, Richfaces.3.3.3, Facelets 1.1.15 , IE9
> Reporter: Jan Ziegler
> Assignee: Leonardo Uribe
>
> When requesting css resources IE9 sends a header accept "text/css" while IE8
> or other browsers send "text/css,*/*".
> When loading a css resource with Richfaces 3.3.3 by using <a4j:loadStyle>
> HtmlRendererUtils.selectContentType throws an IllegalArgumentException
> because "text/css" is not a supported content type:
> {code}
> java.lang.IllegalArgumentException: ContentTypeList does not contain a
> supported content type: text/css
> at
> org.apache.myfaces.shared_impl.renderkit.html.HtmlRendererUtils.selectContentType(HtmlRendererUtils.java:1676)
> at
> org.apache.myfaces.renderkit.html.HtmlRenderKitImpl.createResponseWriter(HtmlRenderKitImpl.java:152)
> at
> org.ajax4jsf.resource.TemplateCSSRenderer.send(TemplateCSSRenderer.java:85)
> at
> org.ajax4jsf.resource.InternetResourceBase.send(InternetResourceBase.java:374)
> at
> org.ajax4jsf.resource.ResourceLifecycle.sendResource(ResourceLifecycle.java:221)
> at
> org.ajax4jsf.resource.ResourceLifecycle.send(ResourceLifecycle.java:148)
> at
> org.ajax4jsf.resource.InternetResourceService.load(InternetResourceService.java:335)
> at org.ajax4jsf.cache.LRUMapCache.load(LRUMapCache.java:116)
> at org.ajax4jsf.cache.LRUMapCache.get(LRUMapCache.java:87)
> at
> org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:195)
> at
> org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:141)
> at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:508)
> {code}
> It does not happen when switching back to IE8 Mode or in other browsers like
> Firefox 3.6, 4.0, Chrome, Safari.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira