[Yanel-commits] rev 22181 - public/yanel/trunk/src/core/java/org/wyona/yanel/servlet

michi at wyona.com michi at wyona.com
Thu Jan 25 18:44:42 CET 2007


Author: michi
Date: 2007-01-25 18:44:41 +0100 (Thu, 25 Jan 2007)
New Revision: 22181

Modified:
   public/yanel/trunk/src/core/java/org/wyona/yanel/servlet/YanelServlet.java
Log:
encoding resp. charset added

Modified: public/yanel/trunk/src/core/java/org/wyona/yanel/servlet/YanelServlet.java
===================================================================
--- public/yanel/trunk/src/core/java/org/wyona/yanel/servlet/YanelServlet.java	2007-01-25 17:42:57 UTC (rev 22180)
+++ public/yanel/trunk/src/core/java/org/wyona/yanel/servlet/YanelServlet.java	2007-01-25 17:44:41 UTC (rev 22181)
@@ -384,7 +384,13 @@
             // Check if the view contains the response, otherwise assume that the resource wrote the response, and just return.
             if (!view.isResponse()) return;
             
-            response.setContentType(patchContentType(view.getMimeType(), request));
+            if (view.getEncoding() != null) {
+                response.setContentType(patchContentType(view.getMimeType() + "; charset=" + view.getEncoding(), request));
+            } else if (res.getConfiguration() != null && res.getConfiguration().getEncoding() != null) {
+                response.setContentType(patchContentType(view.getMimeType() + "; charset=" + res.getConfiguration().getEncoding(), request));
+            } else {
+                response.setContentType(patchContentType(view.getMimeType(), request));
+            }
 
             InputStream is = view.getInputStream();
 




More information about the Yanel-commits mailing list