You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2010/07/03 19:30:43 UTC

svn commit: r960240 - /myfaces/shared/trunk_3.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java

Author: lu4242
Date: Sat Jul  3 17:30:42 2010
New Revision: 960240

URL: http://svn.apache.org/viewvc?rev=960240&view=rev
Log:
MYFACES-2779 PartialResponse bogus response on render all because of falsely positioned development stage script tag (fix supported content type ordering)

Modified:
    myfaces/shared/trunk_3.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java

Modified: myfaces/shared/trunk_3.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk_3.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java?rev=960240&r1=960239&r2=960240&view=diff
==============================================================================
--- myfaces/shared/trunk_3.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java (original)
+++ myfaces/shared/trunk_3.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java Sat Jul  3 17:30:42 2010
@@ -1608,6 +1608,15 @@ public final class HtmlRendererUtils {
     private static String APPLICATION_XML_CONTENT_TYPE = "application/xml";
     private static String TEXT_XML_CONTENT_TYPE = "text/xml";
 
+    // The order is important in this case.
+    private static final String [] SUPPORTED_CONTENT_TYPES = {
+            HTML_CONTENT_TYPE, //Prefer this over any other, because IE does not support XHTML content type
+            XHTML_CONTENT_TYPE,
+            APPLICATION_XML_CONTENT_TYPE,
+            TEXT_XML_CONTENT_TYPE,
+            TEXT_ANY_CONTENT_TYPE,
+            ANY_CONTENT_TYPE
+        };
 
     public static String selectContentType(String contentTypeListString)
     {
@@ -1681,9 +1690,9 @@ public final class HtmlRendererUtils {
 
     public static String[] getSupportedContentTypes()
     {
-        String[] supportedContentTypeArray = new String[]{HTML_CONTENT_TYPE,TEXT_ANY_CONTENT_TYPE,ANY_CONTENT_TYPE,
-                                                          XHTML_CONTENT_TYPE,APPLICATION_XML_CONTENT_TYPE,TEXT_XML_CONTENT_TYPE};
-        return supportedContentTypeArray;
+        //String[] supportedContentTypeArray = new String[]{HTML_CONTENT_TYPE,TEXT_ANY_CONTENT_TYPE,ANY_CONTENT_TYPE,
+        //                                                  XHTML_CONTENT_TYPE,APPLICATION_XML_CONTENT_TYPE,TEXT_XML_CONTENT_TYPE};
+        return SUPPORTED_CONTENT_TYPES;
     }
 
     private static boolean isHTMLContentType(String contentType)