myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bom...@apache.org
Subject svn commit: r742928 - /myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/util/ResponseUtils.java
Date Tue, 10 Feb 2009 10:35:32 GMT
Author: bommel
Date: Tue Feb 10 10:35:19 2009
New Revision: 742928

URL: http://svn.apache.org/viewvc?rev=742928&view=rev
Log:
(TOBAGO-732) Websphere ignores charset if setContentType is called twice

Modified:
    myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/util/ResponseUtils.java

Modified: myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/util/ResponseUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/util/ResponseUtils.java?rev=742928&r1=742927&r2=742928&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/util/ResponseUtils.java
(original)
+++ myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/util/ResponseUtils.java
Tue Feb 10 10:35:19 2009
@@ -60,8 +60,13 @@
       if (!response.containsHeader("Content-Type")) {
         response.setContentType(contentType);
       } else {
-        if (LOG.isInfoEnabled()) {
-          LOG.info("Reponse already contains Header Content-Type. Ignore setting Content-Type
to " + contentType);
+        String responseContentType = response.getContentType();
+        if (!responseContentType.equalsIgnoreCase(contentType)) {
+          response.setContentType(contentType);
+          if (LOG.isInfoEnabled()) {
+            LOG.info("Reponse already contains Header Content-Type '" + responseContentType
+                + "'. Setting Content-Type to '" + contentType + "'");
+          }
         }
       }
     }



Mime
View raw message