Show
Ignore:
Timestamp:
10/11/08 01:14:38 (3 months ago)
Author:
int128
Message:

cookie version

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/java/misc/http-cookie-parser/trunk/webapp/WEB-INF/httpCookieTest.jsp

    r20544 r21092  
    33<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
    44 
    5 <%@page import="java.util.Enumeration"%><html> 
     5<%@page import="java.util.Enumeration"%> 
     6<%@page import="java.util.Map"%> 
     7<html> 
    68<head> 
    79<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
     
    911</head> 
    1012<body onload="document.f.v.focus()"> 
     13 
     14<h1>getParameters()</h1> 
     15 
     16<table border> 
     17<% 
     18for(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> 
    1126 
    1227<h1>getHeaders()</h1> 
     
    4863Enumeration cookies = request.getHeaders("cookie"); 
    4964if(cookies.hasMoreElements()) { 
    50         String cookieRaw = (String) request.getHeaders("cookie").nextElement(); 
     65        String cookieRaw = (String) cookies.nextElement(); 
    5166%> 
    5267<table border> 
    5368<% 
    54         for(String part : cookieRaw.split("; +")) { 
     69        for(String part : cookieRaw.split("; *")) { 
    5570                String key = part.substring(0, part.indexOf('=')); 
    5671                String value = part.substring(part.indexOf('=')+1); 
     
    6984if(request.getCookies() != null) { 
    7085        for(Cookie cookie : request.getCookies()) { 
    71                 if("cookieTest".equals(cookie.getName())) { 
     86                if("test".equals(cookie.getName())) { 
    7287                        cookieValue = cookie.getValue(); 
    7388                } 
     
    7792 
    7893<form method="post" name="f"> 
     94<div><label><input type="radio" name="version" value="-1" />response.setHeader()</label></div> 
    7995<div><label><input type="radio" name="version" value="0" checked="checked" />cookie.setVersion(0)</label></div> 
    8096<div><label><input type="radio" name="version" value="1" />cookie.setVersion(1)</label></div>