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
pull/68/head
reger 8 years ago
parent bf6709d196
commit 036c1dc6ef

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

@ -84,8 +84,14 @@ public class CookieTest_p {
//header. //header.
} }
prop.put("cookiesout", "1"); //prop.put("cookiesout", "1");
prop.putHTML("cookiesout_0_string", header.getHeaderCookies().replaceAll(";",";<br />")); 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; return prop;
} }
} }

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

Loading…
Cancel
Save