cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From da...@cocoon.zones.apache.org
Subject [DAISY] Created: Response Object
Date Thu, 07 Jun 2007 16:52:04 GMT
A new document has been created.

http://cocoon.zones.apache.org/daisy/documentation/1384.html

Document ID: 1384
Branch: main
Language: default
Name: Response Object
Document Type: Cocoon Document
Created: 6/7/07 4:52:00 PM
Creator (owner): Reinhard Pötz
State: publish

Parts
=====

Content
-------
Mime type: text/xml
Size: 4191 bytes
Content:
<html>
<body>

<p>The <tt>Response</tt> object represents the Cocoon response associated
with
the current request.</p>

<p>The response object contains hooks only to the cookies and to the response
headers. Everything else will be controlled by the rest of the cocoon pipeline
machinery (like output encoding, for example, which should *NOT* be determined
by the flow).</p>

<p>It provides the following functions and properties:</p>

<h3>createCookie</h3>

<p><em>Function</em> <tt>[Cookie] createCookie([String] name, [String]
value)</tt></p>

<p>Creates a new <a href="#cookie">Cookie</a>.</p>

<h3>addCookie</h3>

<p><em>Function</em> <tt>addCookie([Cookie] cookie)</tt></p>

<p>Adds <tt>cookie</tt> to the current response.</p>

<h3>containsHeader</h3>

<p><em>Function</em> <tt>[Boolean] containsHeader([String] name)</tt></p>

<p>Returns whether the current response contains a header with the specified
<tt>name</tt>.</p>

<h3>setHeader</h3>

<p><em>Function</em> <tt>setHeader([String] name, [String] value)</tt></p>

<p>Replaces the value of the header with <tt>name</tt> with <tt>value</tt>.</p>

<h3>addHeader</h3>

<p><em>Function</em> <tt>addHeader([String] name, [String] value)</tt></p>

<p>Creates a new header in the current response with the specified <tt>name</tt>
and <tt>value</tt>.</p>

<h3>setStatus</h3>

<p><em>Function</em> <tt>setStatus([Number] sc)</tt></p>

<p>Sets the status code for this response.</p>

<h2 id="session">Session Object</h2>

<p>The <tt>Session</tt> object represents the user session associated with
the
current Cocoon request.</p>

<p>It provides the following functions and properties:</p>

<h3>getAttribute</h3>

<p><em>Function</em> <tt>[Object] getAttribute([String] name)</tt></p>

<p>Get the value of the session attribute with the specified <tt>name</tt>.</p>

<h3>setAttribute</h3>

<p><em>Function</em> <tt>setAttribute([String] name, [Object] value)</tt></p>

<p>Set the value of the session attribute with the specified <tt>name</tt>
to
<tt>value</tt>.</p>

<h3>removeAttribute</h3>

<p><em>Function</em> <tt>removeAttribute([String] name)</tt></p>

<p>Remove the session attribute with the specified <tt>name</tt>.</p>

<h3>invalidate</h3>

<p><em>Function</em> <tt>invalidate()</tt></p>

<p>Invalidate this session, releasing all resources associated with it.</p>

<h3>isNew</h3>

<p><em>Function</em> <tt>[Boolean] isNew()</tt></p>

<p>Returns <tt>true</tt> if the client does not yet know about the session
or if
the client chooses not to join the session. For example, if the server used only
cookie-based sessions, and the client had disabled the use of cookies, then a
session would be new on each request.</p>

<h3>getId</h3>

<p><em>Function</em> <tt>[String] getId()</tt></p>

<p>Returns the unique id associated with this session.</p>

<h3>getCreationTime</h3>

<p><em>Function</em> <tt>[Number] getCreationTime()</tt></p>

<p>Returns the time when this session was created, measured in milliseconds
since midnight January 1, 1970 GMT.</p>

<h3>getLastAccessedTime</h3>

<p><em>Function</em> <tt>[Number] getLastAccessedTime()</tt></p>

<p>Returns the last time the client sent a request associated with this session,
as the number of milliseconds since midnight January 1, 1970 GMT.</p>

<h3>setMaxInactiveInterval</h3>

<p><em>Function</em> <tt>setMaxInactiveInterval([Number] interval)</tt></p>

<p>Specifies the time, in seconds, between client requests before the
contextcontainer will invalidate this session. A negative time indicates the
session should never timeout.</p>

<h3>getMaxInactiveInterval</h3>

<p><em>Function</em> <tt>[Number] getMaxInactiveInterval()</tt></p>

<p>Returns the maximum time interval, in seconds, that the context container
will keep this session open between client accesses. After this interval, the
context container will invalidate the session. The maximum time interval can be
set with the <tt>setMaxInactiveInterval</tt> method. A negative time indicates
the session should never timeout.</p>

<h3>Properties</h3>

<p><tt>Session</tt> properties map to session attributes, i.e.
<tt>session.blah</tt> is equivalent to <tt>session.getAttribute("blah")</tt>.
</p>

</body>
</html>

Collections
===========
The document belongs to the following collections: cdocs-flowscript

Mime
View raw message