fix CookieTest_p formatting (output of <br> as text),

change to dataoutput only by servlet, leave formatting to html.
+ removed link to obsolete env/grafics gif
This commit is contained in:
reger 2016-08-20 22:23:47 +02:00
parent bf6709d196
commit 036c1dc6ef
3 changed files with 18 additions and 7 deletions

View File

@ -28,7 +28,7 @@
</fieldset>
</form>
<hr />
<p>Cookies at this browser:</p>
<h3>Cookies at this browser:</h3>
<p>
<script type="text/javascript">
<!--
@ -39,16 +39,16 @@
#(cookiesout)#
::
<hr />
<p>Cookies coming to server:</p>
<h3>Cookies coming to server:</h3>
#(/cookiesout)#
<p>#{cookiesout}#
#[string]#
#[string]#<br />
#{/cookiesout}#</p>
#(cookiesin)#
::
<hr />
<p>Cookies server sent:</p>
<h3>Cookies server sent:</h3>
#(/cookiesin)#
<p>#{cookiesin}#
#[name]# = #[value]#
@ -57,7 +57,6 @@
<p class="info">YaCy is a GPL'ed project
with the target of implementing a P2P-based global search engine.<br />
Architecture (C) by Michael Peter Christen,
<img src="env/grafics/mcemailh.gif" alt="Mail-Adresse von Michael Peter Christen" />
</p>
#%env/templates/footer.template%#
</body>

View File

@ -84,8 +84,14 @@ public class CookieTest_p {
//header.
}
prop.put("cookiesout", "1");
prop.putHTML("cookiesout_0_string", header.getHeaderCookies().replaceAll(";",";<br />"));
//prop.put("cookiesout", "1");
String[] cookielst = header.getHeaderCookies().split(";");
int i = 0;
for (String singleco : cookielst) {
prop.putHTML("cookiesout_" + i + "_string", singleco + ";"); // output with ";" for compatiblity with cookiesin
i++;
}
prop.put("cookiesout", i);
return prop;
}
}

View File

@ -750,6 +750,12 @@ public class HeaderFramework extends TreeMap<String, String> implements Map<Stri
{
setCookie( name, value, null, null, null, false);
}
/**
* Gets the header entry "Cookie"
*
* @return String with cookies separated by ';'
*/
public String getHeaderCookies(){
final Iterator<Map.Entry<String, String>> it = entrySet().iterator();
while(it.hasNext())