org.apache.cocoon.acting
Class CookieCreatorAction

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.apache.cocoon.acting.AbstractAction
          extended byorg.apache.cocoon.acting.ServiceableAction
              extended byorg.apache.cocoon.acting.CookieCreatorAction
All Implemented Interfaces:
Action, LogEnabled, Serviceable, ThreadSafe

public class CookieCreatorAction
extends ServiceableAction
implements ThreadSafe

The CookieCreatorAction class create or remove cookies. The action needs these parameters:

name
the cookie name
value
the cookie value
comment
a comment to the cookie
domain
the domain the cookie is sent to
path
the path of the domain the cookie is sent to
secure
use a secure transport protocol (default is false)
maxage
Age in seconds. Use -1 to remove cookie. (default is 0; cookie lives within the session and it is not stored)
version
version of cookie(default is 0)
If you want to set a cookie you only need to specify the cookie name. Its value is an empty string as default. The maxage is 0 that means the cookie will live until the session is invalidated. If you want to remove a cookie set its maxage to -1.

Version:
CVS $Id: CookieCreatorAction.java 171341 2005-05-22 16:35:41Z cziegeler $
Author:
Paolo Scaffardi

Field Summary
 
Fields inherited from class org.apache.cocoon.acting.ServiceableAction
manager
 
Fields inherited from class org.apache.cocoon.acting.AbstractAction
EMPTY_MAP
 
Fields inherited from interface org.apache.cocoon.acting.Action
ROLE
 
Constructor Summary
CookieCreatorAction()
           
 
Method Summary
 Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String src, Parameters parameters)
          Creates a cookie.
 
Methods inherited from class org.apache.cocoon.acting.ServiceableAction
service
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CookieCreatorAction

public CookieCreatorAction()
Method Detail

act

public Map act(Redirector redirector,
               SourceResolver resolver,
               Map objectModel,
               String src,
               Parameters parameters)
        throws Exception
Creates a cookie.

Specified by:
act in interface Action
Parameters:
resolver - The SourceResolver in charge
objectModel - The Map with object of the calling environment which can be used to select values this controller may need (ie Request, Response).
src - A source String to the Action
parameters - The Parameters for this invocation
Returns:
Empty map on success, null on failure.
Throws:
Exception - Indicates something is totally wrong


Copyright ? 1999-2005 The Apache Software Foundation. All Rights Reserved.