You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@labs.apache.org by si...@apache.org on 2008/09/30 15:23:55 UTC

svn commit: r700457 - /labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/Dispatch.java

Author: simoneg
Date: Tue Sep 30 06:23:55 2008
New Revision: 700457

URL: http://svn.apache.org/viewvc?rev=700457&view=rev
Log:
UTF-8 fixes

Modified:
    labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/Dispatch.java

Modified: labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/Dispatch.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/Dispatch.java?rev=700457&r1=700456&r2=700457&view=diff
==============================================================================
--- labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/Dispatch.java (original)
+++ labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/Dispatch.java Tue Sep 30 06:23:55 2008
@@ -83,6 +83,8 @@
 	}
 
 	protected void handleHtml(HtmlProducer producer, HttpServletRequest req, HttpServletResponse resp) {
+		resp.setContentType("text/html; charset=utf-8");
+		
 		String mybaseurl = "";
 		if (req.getContextPath().length() > 0) {
 			mybaseurl += req.getContextPath();
@@ -131,6 +133,12 @@
 	}
 
 	protected void handleResource(Producer producer, HttpServletResponse resp) {
+		String contentType = producer.getMimeType();
+		if (contentType == null) contentType = "application/octet-stream";
+		if (contentType.startsWith("text")) {
+			contentType += "; charset=utf-8";
+		}
+		resp.setContentType(contentType);
 		try {
 			producer.produce(resp.getOutputStream());
 		} catch (IOException e) {



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org