diff options
| author | low012 <low012@6c8d7289-2bf4-0310-a012-ef5d649a1542> | 2007-05-25 19:54:54 +0000 |
|---|---|---|
| committer | low012 <low012@6c8d7289-2bf4-0310-a012-ef5d649a1542> | 2007-05-25 19:54:54 +0000 |
| commit | a97a3756fee700b119daedfcc8943dd00b64bd42 (patch) | |
| tree | e9ab8dbf78c537ced8ff3080236317da4940c98a /htroot | |
| parent | a0149317ac6465fe72a60ac495e66a2a63efba21 (diff) | |
*) got rid of HTML in Java classes that led to HTML tags being displayed on monitor pages
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3763 6c8d7289-2bf4-0310-a012-ef5d649a1542
Diffstat (limited to 'htroot')
| -rw-r--r-- | htroot/CookieMonitorIncoming_p.html | 2 | ||||
| -rw-r--r-- | htroot/CookieMonitorIncoming_p.java | 26 | ||||
| -rw-r--r-- | htroot/CookieMonitorOutgoing_p.html | 2 | ||||
| -rw-r--r-- | htroot/CookieMonitorOutgoing_p.java | 26 |
4 files changed, 30 insertions, 26 deletions
diff --git a/htroot/CookieMonitorIncoming_p.html b/htroot/CookieMonitorIncoming_p.html index c64251beb..58c5b6756 100644 --- a/htroot/CookieMonitorIncoming_p.html +++ b/htroot/CookieMonitorIncoming_p.html @@ -22,7 +22,7 @@ <td>#[host]#</td>
<td>#[date]#</td>
<td>#[client]#</td>
- <td>#[cookie]#</td>
+ <td><ul>#{cookies}#<li>#[item]#</li>#{/cookies}#</ul></td>
</tr>
#{/list}#
</table>
diff --git a/htroot/CookieMonitorIncoming_p.java b/htroot/CookieMonitorIncoming_p.java index bb31c783d..6d03ad926 100644 --- a/htroot/CookieMonitorIncoming_p.java +++ b/htroot/CookieMonitorIncoming_p.java @@ -4,7 +4,7 @@ // (C) by Michael Peter Christen; mc@anomic.de
// first published on http://www.anomic.de
// Frankfurt, Germany, 2004, 2005
-// last change: 25.02.2005
+// last change: 25.05.2007
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -54,21 +54,21 @@ import de.anomic.server.serverObjects; import de.anomic.server.serverSwitch;
public class CookieMonitorIncoming_p {
-
+
public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch sb) {
plasmaSwitchboard switchboard = (plasmaSwitchboard) sb;
-
+
// return variable that accumulates replacements
serverObjects prop = new serverObjects();
-
+
int maxCount = 100;
int entCount = 0;
+ int tmpCount = 0;
boolean dark = true;
Iterator i = switchboard.incomingCookies.entrySet().iterator();
Map.Entry entry;
String host, client;
Object[] cookies;
- String ucl;
Date date;
Object[] oa;
while ((entCount < maxCount) && (i.hasNext())) {
@@ -79,17 +79,19 @@ public class CookieMonitorIncoming_p { date = (Date) oa[0];
client = (String) oa[1];
cookies = (Object[]) oa[2];
- ucl = "<ul>";
- for (int j = 0; j < cookies.length; j++) ucl = ucl + "<li>" + ((String) cookies[j]) + "</li>";
- ucl = ucl + "</ul>";
-
+
// put values in template
prop.put("list_" + entCount + "_dark", ((dark) ? 1 : 0) ); dark =! dark;
prop.put("list_" + entCount + "_host", host);
prop.put("list_" + entCount + "_date", httpc.dateString(date));
prop.put("list_" + entCount + "_client", client);
- prop.put("list_" + entCount + "_cookie", ucl);
-
+ while (tmpCount < cookies.length){
+ prop.put("list_" + entCount + "_cookies_" + tmpCount + "_item", ((String) cookies[tmpCount]));
+ tmpCount++;
+ }
+ prop.put("list_" + entCount + "_cookies", tmpCount);
+ tmpCount = 0;
+
// next
entCount++;
}
@@ -99,5 +101,5 @@ public class CookieMonitorIncoming_p { // return rewrite properties
return prop;
}
-
+
}
diff --git a/htroot/CookieMonitorOutgoing_p.html b/htroot/CookieMonitorOutgoing_p.html index d7a34ca9c..fe4d64084 100644 --- a/htroot/CookieMonitorOutgoing_p.html +++ b/htroot/CookieMonitorOutgoing_p.html @@ -26,7 +26,7 @@ <td>#[host]#</td>
<td>#[date]#</td>
<td>#[client]#</td>
- <td>#[cookie]#</td>
+ <td><ul>#{cookies}#<li>#[item]#</li>#{/cookies}#</ul></td>
</tr>
#{/list}#
</table>
diff --git a/htroot/CookieMonitorOutgoing_p.java b/htroot/CookieMonitorOutgoing_p.java index 7b6b473f8..571639cee 100644 --- a/htroot/CookieMonitorOutgoing_p.java +++ b/htroot/CookieMonitorOutgoing_p.java @@ -4,7 +4,7 @@ // (C) by Michael Peter Christen; mc@anomic.de
// first published on http://www.anomic.de
// Frankfurt, Germany, 2004, 2005
-// last change: 25.02.2005
+// last change: 25.05.2007
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -54,21 +54,21 @@ import de.anomic.server.serverObjects; import de.anomic.server.serverSwitch;
public class CookieMonitorOutgoing_p {
-
+
public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch sb) {
plasmaSwitchboard switchboard = (plasmaSwitchboard) sb;
-
+
// return variable that accumulates replacements
serverObjects prop = new serverObjects();
-
+
int maxCount = 100;
int entCount = 0;
+ int tmpCount = 0;
boolean dark = true;
Iterator i = switchboard.outgoingCookies.entrySet().iterator();
Map.Entry entry;
String host, client;
Object[] cookies;
- String ucl;
Date date;
Object[] oa;
while ((entCount < maxCount) && (i.hasNext())) {
@@ -79,17 +79,19 @@ public class CookieMonitorOutgoing_p { date = (Date) oa[0];
client = (String) oa[1];
cookies = (Object[]) oa[2];
- ucl = "<ul>";
- for (int j = 0; j < cookies.length; j++) ucl = ucl + "<li>" + ((String) cookies[j]) + "</li>";
- ucl = ucl + "</ul>";
-
+
// put values in template
prop.put("list_" + entCount + "_dark", ((dark) ? 1 : 0) ); dark =! dark;
prop.put("list_" + entCount + "_host", host);
prop.put("list_" + entCount + "_date", httpc.dateString(date));
prop.put("list_" + entCount + "_client", client);
- prop.put("list_" + entCount + "_cookie", ucl);
-
+ while (tmpCount < cookies.length){
+ prop.put("list_" + entCount + "_cookies_" + tmpCount + "_item", ((String) cookies[tmpCount]));
+ tmpCount++;
+ }
+ prop.put("list_" + entCount + "_cookies", tmpCount);
+ tmpCount = 0;
+
// next
entCount++;
}
@@ -99,5 +101,5 @@ public class CookieMonitorOutgoing_p { // return rewrite properties
return prop;
}
-
+
}
|
