2006/unicorn/src/org/w3c/unicorn/action IndexAction.java,1.9,1.10 ObserveAction.java,1.10,1.11

Update of /sources/public/2006/unicorn/src/org/w3c/unicorn/action
In directory hutz:/tmp/cvs-serv25473/src/org/w3c/unicorn/action

Modified Files:
	IndexAction.java ObserveAction.java 
Log Message:
changing language does not loose the observation parameters

Index: IndexAction.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/action/IndexAction.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- IndexAction.java	3 Sep 2009 12:28:49 -0000	1.9
+++ IndexAction.java	3 Sep 2009 14:04:12 -0000	1.10
@@ -55,11 +55,22 @@
 		velocityContext = new VelocityContext(Language.getContext(langParameter));
 		
 		String query = req.getQueryString();
-		String queryString = "";
+		String queryString;
+		if (query == null) {
+			queryString = "./?";
+		} else {
+			queryString = "?";
+			queryString += query.replaceAll("&?ucn_lang=[^&]*", "");
+			if (!queryString.equals("?"))
+				queryString += "&";
+		}
+		
+		/*String query = req.getQueryString();
+		String queryString = "?";
 		if (query != null)
-			queryString = query.replaceAll("&?ucn_lang=[^&]*", "");
-		if (!queryString.equals(""))
-			queryString += "&";
+			queryString += query.replaceAll("&?ucn_lang=[^&]*", "");
+		if (!queryString.equals("?"))
+			queryString += "&";*/
 		velocityContext.put("queryString", queryString);
 		
 		/*messages.add(new Message(Message.Level.WARNING, "un warning", null));

Index: ObserveAction.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/action/ObserveAction.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- ObserveAction.java	3 Sep 2009 12:28:49 -0000	1.10
+++ ObserveAction.java	3 Sep 2009 14:04:12 -0000	1.11
@@ -104,16 +104,18 @@
 		
 		
 		String query = req.getQueryString();
-		String queryString = "";
-		if (query != null)
-			queryString = query.replaceAll("&?ucn_lang=[^&]*", "");
-		if (!queryString.equals(""))
-			queryString += "&";
+		String queryString;
+		if (query == null) {
+			queryString = "./?";
+		} else {
+			queryString = "?";
+			queryString += query.replaceAll("&?ucn_lang=[^&]*", "");
+			if (!queryString.equals("?"))
+				queryString += "&";
+		}
 		mapOfStringObject.put("queryString", queryString);
 		
 		
-		
-		
 		// Variables related to the output
 		final Map<String, String[]> mapOfSpecificParameter = new Hashtable<String, String[]>();
 		final Map<String, String> mapOfOutputParameter = new Hashtable<String, String>();
@@ -211,6 +213,15 @@
 		if (langParameter == null || !Framework.getLanguageProperties().containsKey(langParameter))
 			langParameter = Language.negociate(req.getLocales());
 		
+		//String query = req.getQueryString();
+		String queryString = "./?";
+		//if (query != null)
+		//	queryString += query.replaceAll("&?ucn_lang=[^&]*", "");
+		//if (!queryString.equals("?"))
+		//	queryString += "&";
+		mapOfStringObject.put("queryString", queryString);
+		
+		
 		// Variables related to the output
 		final Map<String, String> mapOfOutputParameter = new Hashtable<String, String>();
 		mapOfOutputParameter.put("output", "simple");

Received on Thursday, 3 September 2009 14:04:26 UTC