- Timestamp:
- 10/11/08 01:14:38 (3 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/java/misc/http-cookie-parser/trunk/webapp/WEB-INF/httpCookieTest.jsp
r20544 r21092 3 3 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 4 4 5 <%@page import="java.util.Enumeration"%><html> 5 <%@page import="java.util.Enumeration"%> 6 <%@page import="java.util.Map"%> 7 <html> 6 8 <head> 7 9 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> … … 9 11 </head> 10 12 <body onload="document.f.v.focus()"> 13 14 <h1>getParameters()</h1> 15 16 <table border> 17 <% 18 for(Object e : request.getParameterMap().entrySet()) { 19 Map.Entry entry = (Map.Entry) e; 20 %> 21 <tr><td><%= entry.getKey() %></td><td><%= entry.getValue() %></td></tr> 22 <% 23 } 24 %> 25 </table> 11 26 12 27 <h1>getHeaders()</h1> … … 48 63 Enumeration cookies = request.getHeaders("cookie"); 49 64 if(cookies.hasMoreElements()) { 50 String cookieRaw = (String) request.getHeaders("cookie").nextElement();65 String cookieRaw = (String) cookies.nextElement(); 51 66 %> 52 67 <table border> 53 68 <% 54 for(String part : cookieRaw.split("; +")) {69 for(String part : cookieRaw.split("; *")) { 55 70 String key = part.substring(0, part.indexOf('=')); 56 71 String value = part.substring(part.indexOf('=')+1); … … 69 84 if(request.getCookies() != null) { 70 85 for(Cookie cookie : request.getCookies()) { 71 if(" cookieTest".equals(cookie.getName())) {86 if("test".equals(cookie.getName())) { 72 87 cookieValue = cookie.getValue(); 73 88 } … … 77 92 78 93 <form method="post" name="f"> 94 <div><label><input type="radio" name="version" value="-1" />response.setHeader()</label></div> 79 95 <div><label><input type="radio" name="version" value="0" checked="checked" />cookie.setVersion(0)</label></div> 80 96 <div><label><input type="radio" name="version" value="1" />cookie.setVersion(1)</label></div>
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)