W3C home > Mailing lists > Public > www-validator-cvs@w3.org > August 2009

2006/unicorn/src/org/w3c/unicorn/action TestAction.java,1.1.2.1,1.1.2.2 IndexAction.java,1.1.2.13,1.1.2.14

From: Thomas Gambet via cvs-syncmail <cvsmail@w3.org>
Date: Fri, 21 Aug 2009 07:04:47 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1MeOB5-0007Xv-0p@lionel-hutz.w3.org>
Update of /sources/public/2006/unicorn/src/org/w3c/unicorn/action
In directory hutz:/tmp/cvs-serv28928/src/org/w3c/unicorn/action

Modified Files:
      Tag: dev2
	TestAction.java IndexAction.java 
Log Message:
added ajax on index page

Index: IndexAction.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/action/Attic/IndexAction.java,v
retrieving revision 1.1.2.13
retrieving revision 1.1.2.14
diff -u -d -r1.1.2.13 -r1.1.2.14
--- IndexAction.java	20 Aug 2009 14:06:22 -0000	1.1.2.13
+++ IndexAction.java	21 Aug 2009 07:04:44 -0000	1.1.2.14
@@ -42,8 +42,14 @@
 		
 		velocityContext.put("current_task", Framework.mapOfTask.get(taskParameter));
 		
-		Framework.getTemplate("index").merge(velocityContext, resp.getWriter());
-		resp.getWriter().close();
+		if (req.getHeader("X-Requested-With") != null && req.getHeader("X-Requested-With").equals("XMLHttpRequest")) {
+			
+			Framework.getTemplate("parameters").merge(velocityContext, resp.getWriter());
+			resp.getWriter().close();
+		} else {
+			Framework.getTemplate("index").merge(velocityContext, resp.getWriter());
+			resp.getWriter().close();
+		}
 	}
 
 	@Override

Index: TestAction.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/action/Attic/TestAction.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -d -r1.1.2.1 -r1.1.2.2
--- TestAction.java	19 Aug 2009 17:41:36 -0000	1.1.2.1
+++ TestAction.java	21 Aug 2009 07:04:44 -0000	1.1.2.2
@@ -2,6 +2,7 @@
 
 import java.io.IOException;
 import java.io.PrintWriter;
+import java.util.Enumeration;
 
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServlet;
@@ -41,6 +42,10 @@
 			
 			
 		}
+		Enumeration en = req.getHeaderNames();
+		while(en.hasMoreElements()) {
+			out.println(en.nextElement());
+		}
 		
 		/*resp.setContentType("text/html; charset=UTF-8");
 		
Received on Friday, 21 August 2009 07:04:56 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:17:38 UTC