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 2009/11/18 17:36:27 UTC

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

Author: simoneg
Date: Wed Nov 18 16:36:27 2009
New Revision: 881830

URL: http://svn.apache.org/viewvc?rev=881830&view=rev
Log:
Wrapping DIV around .ajax call

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=881830&r1=881829&r2=881830&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 Wed Nov 18 16:36:27 2009
@@ -25,6 +25,7 @@
 import org.apache.magma.basics.startup.Startup;
 
 import java.io.IOException;
+import java.io.OutputStream;
 import java.io.PrintStream;
 import java.lang.reflect.Method;
 import java.util.HashMap;
@@ -177,7 +178,24 @@
 			contentType += "; charset=utf-8";
 		}
 		resp.setContentType(contentType);
-		producer.produce(Cycle.get().getRewriting());
+		OutputStream str = Cycle.get().getRewriting();
+		if (producer instanceof HtmlProducer) {
+			try {
+				str.write("<div class=\"AjaxWrapper ".getBytes("UTF-8"));
+				str.write(Template.computeCompleteProducerClasses((HtmlProducer) producer).getBytes("UTF-8"));
+				str.write("\">".getBytes("UTF-8"));
+			} catch (Exception e) {
+				// It could be either an unmanageable IOException or an impossible Unsupported encoding exception
+			}
+		}
+		producer.produce(str);
+		if (producer instanceof HtmlProducer) {
+			try {
+				str.write("</div>".getBytes("UTF-8"));
+			} catch (Exception e) {
+				// It could be either an unmanageable IOException or an impossible Unsupported encoding exception
+			}
+		}		
 	}
 
 	public void handleHTML(HtmlProducer producer, HttpServletRequest req, HttpServletResponse resp) {



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