jacquard 1.12.0 by The Web Engineering Factory and Toolworks

uk.co.weft.htform
Class Cookie

java.lang.Object
  extended byuk.co.weft.htform.Cookie

public class Cookie
extends java.lang.Object

A cookie, set in an HTTP response. Why use this, rather than Sun's Cookie class? Well, because of my context mechanism. The values returned by cookies should just be values in the context like any others. You should not need to instantiate this class directly. Add cookies to the servlet using the addCookie() method at Servlet initialisation time. Any the value of any name in the service context which is the sane as the name of a cookie will be set on that cookie automagically and there is nothing further you need to do. TODO: in Jacquard 2, should probably be protected

Version:
$Revision: 1.12.4.1 $
Author:
Simon Brooke (simon@jasmine.org.uk)
See Also:
This revision: @author $Author: simon $
  $Log: Cookie.java,v $
  Revision 1.12.4.1  2005/12/23 10:48:33  simon
  Brute force tidy up after CVS server crash: this time it should work.

  Revision 1.12  2003/08/20 09:38:35  simon
  Code cleanup with eclipse; mostly removal of exccessive includes

  Revision 1.11  2003/07/25 09:57:52  simon
  Cleaned up printing to System.err.

  Revision 1.10  2003/03/25 11:43:17  simon
  Major overhaul. Coerce names to lower case to prevent case-sensitivity
  clashes; add useful symbolic values for TTLs; improve domain handling.

  Revision 1.9  2001/11/11 11:30:49  simon
  Better documentation; better handling of the case where the value
  isn't a string.

  Revision 1.8  2000/05/26 14:50:47  simon
  Made cookie time-to-live generally configurable; gave list optional,
  configurable search widget

  Revision 1.7  1999/07/29 08:50:22  simon
  Changes primarily relate to tidying up after the great
  re-engineering, but one significant addition is ShuffleWidget, a
  double side-by-side multi-select to make up for deficiencies in the
  Microsoft Windows user interface. At this checkpoint there are known
  bugs in DateWidget and LinkTableWidget.
 
  Revision 1.6  1999/07/19 18:20:31  simon
  Checkpoint at first nearly working version of BT Homepage editing
  suite. Main additions to htform are MultiSelectWidget, which does
  just what you would expect, and LinkTableWidget, a specialisation of
  MultiSelectWidget to support the editing of simple many-to-many link
  tables.
 
  Revision 1.5  1999/07/14 18:05:11  simon
  The Great Re-engineering
 
  What had been a simple little package to produce hypertext forms has
  grown remarkably. The original motivations were to handle sessions
  more elegantly and to further abstract database handling. The
  database handling classes have been moved into a new, independent,
  packags, dbutil, which, in addition to automatically handling
  synchronisation of data between the application and database layers,
  is also intended to maintain an efficient, secure pool of database
  connections.
 
  Revision 1.4  1998/12/10 10:53:13  simon
  Streamline brought into line with corrected class-names, method names
  from HTForm; classes Auxiliary, Button and ResultFormatter moved from
  Streamline to HTForm; some related code clean-up; further improvements
  in documentation.
 
  Revision 1.3  1998/12/09 16:07:54  simon
  The Great Renaming.
 
  All classes renamed to remove initial 'HT', and many methods renamed
  to have lower case initial letters, in order to conform with
  widely used Java naming conventions. More work on making comments
  javadoc friendly.
 
  

Field Summary
protected  java.lang.String domain
          my domain; by default none, because it's too hard to automatically derive one safely
protected  java.lang.String name
          my name
static int ONEDAY
          static finals to make setting lifetimes easier: a day...
static int ONEMONTH
          static finals to make setting lifetimes easier: a month...
static int ONEWEEK
          static finals to make setting lifetimes easier: a week...
static int ONEYEAR
          static finals to make setting lifetimes easier: a year...
protected  java.lang.String path
          by default, this cookie is for every service from this server
 
Constructor Summary
Cookie(java.lang.String myName)
          Create me with a name
Cookie(java.lang.String myName, int ttl)
          Create me with a name and lifetime in seconds
Cookie(java.lang.String name, int ttl, java.lang.String domain, java.lang.String path)
          Preferred: construct me with all possible detail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ONEDAY

public static final int ONEDAY
static finals to make setting lifetimes easier: a day...

See Also:
Constant Field Values

ONEWEEK

public static final int ONEWEEK
static finals to make setting lifetimes easier: a week...

See Also:
Constant Field Values

ONEMONTH

public static final int ONEMONTH
static finals to make setting lifetimes easier: a month...

See Also:
Constant Field Values

ONEYEAR

public static final int ONEYEAR
static finals to make setting lifetimes easier: a year...

See Also:
Constant Field Values

name

protected java.lang.String name
my name


path

protected java.lang.String path
by default, this cookie is for every service from this server


domain

protected java.lang.String domain
my domain; by default none, because it's too hard to automatically derive one safely

Constructor Detail

Cookie

public Cookie(java.lang.String myName)
Create me with a name


Cookie

public Cookie(java.lang.String myName,
              int ttl)
Create me with a name and lifetime in seconds


Cookie

public Cookie(java.lang.String name,
              int ttl,
              java.lang.String domain,
              java.lang.String path)
Preferred: construct me with all possible detail


jacquard 1.12.0 by The Web Engineering Factory and Toolworks