| Java Programming Resources home.
|
| Core Web Programming home.
|
|
Following is the source code for CookieParser and all
supporting Java classes. This class parses the "Cookie:"
HTTP request line and makes individual URL-decoded cookie values
available in a lookup table with the name as a key. It supports having
multiple values associated with the same name.
-
CookieParser.java -- the top-level parser.
-
CgiParser.java -- the underlying parser.
-
LookupTable.java -- a data structure used to store the
results.
-
URLDecoder.java -- the decoder of individual values.
-
StringVector.java -- an internal data structure.
-
CssTest.java. An example of the use of CookieParser. This
creates an input page where the user can select cascading
style sheet values, displays the result, and "remembers"
the choices to use as the default next time. Uses
CssChoices.java internally, plus needs
a simple shell script to act as a CGI interface (Unix;
use a similar .bat file on Windows).
-
CssTest -- An on-line demonstration of the cookie parser
in action.
For more information and related classes, see the
Guide to CGI Programming in Java or
the source code archive for Core Web Programming.