<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
<!--NewPage--> | |
<HTML> | |
<HEAD> | |
<!-- Generated by javadoc (build 1.5.0_14) on Mon Apr 26 10:16:14 PDT 2010 --> | |
<TITLE> | |
CookieTool (VelocityTools 2.0 Documentation) | |
</TITLE> | |
<META NAME="keywords" CONTENT="org.apache.velocity.tools.view.CookieTool class"> | |
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> | |
<SCRIPT type="text/javascript"> | |
function windowTitle() | |
{ | |
parent.document.title="CookieTool (VelocityTools 2.0 Documentation)"; | |
} | |
</SCRIPT> | |
<NOSCRIPT> | |
</NOSCRIPT> | |
</HEAD> | |
<BODY BGCOLOR="white" onload="windowTitle();"> | |
<!-- ========= START OF TOP NAVBAR ======= --> | |
<A NAME="navbar_top"><!-- --></A> | |
<A HREF="#skip-navbar_top" title="Skip navigation links"></A> | |
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> | |
<TR> | |
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> | |
<A NAME="navbar_top_firstrow"><!-- --></A> | |
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> | |
<TR ALIGN="center" VALIGN="top"> | |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> | |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> | |
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> | |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> | |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> | |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> | |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> | |
</TR> | |
</TABLE> | |
</TD> | |
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> | |
</EM> | |
</TD> | |
</TR> | |
<TR> | |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> | |
<A HREF="../../../../../org/apache/velocity/tools/view/BrowserTool.html" title="class in org.apache.velocity.tools.view"><B>PREV CLASS</B></A> | |
<A HREF="../../../../../org/apache/velocity/tools/view/CookieTool.SugarCookie.html" title="class in org.apache.velocity.tools.view"><B>NEXT CLASS</B></A></FONT></TD> | |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> | |
<A HREF="../../../../../index.html?org/apache/velocity/tools/view/CookieTool.html" target="_top"><B>FRAMES</B></A> | |
<A HREF="CookieTool.html" target="_top"><B>NO FRAMES</B></A> | |
<SCRIPT type="text/javascript"> | |
<!-- | |
if(window==top) { | |
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); | |
} | |
//--> | |
</SCRIPT> | |
<NOSCRIPT> | |
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> | |
</NOSCRIPT> | |
</FONT></TD> | |
</TR> | |
<TR> | |
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> | |
SUMMARY: <A HREF="#nested_class_summary">NESTED</A> | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> | |
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> | |
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> | |
</TR> | |
</TABLE> | |
<A NAME="skip-navbar_top"></A> | |
<!-- ========= END OF TOP NAVBAR ========= --> | |
<HR> | |
<!-- ======== START OF CLASS DATA ======== --> | |
<H2> | |
<FONT SIZE="-1"> | |
org.apache.velocity.tools.view</FONT> | |
<BR> | |
Class CookieTool</H2> | |
<PRE> | |
java.lang.Object | |
<IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.velocity.tools.view.CookieTool</B> | |
</PRE> | |
<DL> | |
<DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../../../org/apache/velocity/tools/view/tools/CookieTool.html" title="class in org.apache.velocity.tools.view.tools">CookieTool</A></DD> | |
</DL> | |
<HR> | |
<DL> | |
<DT><PRE><FONT SIZE="-1"><A HREF="../../../../../org/apache/velocity/tools/config/DefaultKey.html" title="annotation in org.apache.velocity.tools.config">@DefaultKey</A>(<A HREF="../../../../../org/apache/velocity/tools/config/DefaultKey.html#value()">value</A>="cookies") | |
<A HREF="../../../../../org/apache/velocity/tools/config/ValidScope.html" title="annotation in org.apache.velocity.tools.config">@ValidScope</A>(<A HREF="../../../../../org/apache/velocity/tools/config/ValidScope.html#value()">value</A>="request") | |
</FONT>public class <B>CookieTool</B><DT>extends java.lang.Object</DL> | |
</PRE> | |
<P> | |
<p>View tool for convenient cookie access and creation.</p> | |
<p><pre> | |
Template example(s): | |
$cookie.foo | |
$cookie.add("bar",'woogie') | |
tools.xml configuration: | |
<tools> | |
<toolbox scope="request"> | |
<tool class="org.apache.velocity.tools.view.CookieTool"/> | |
</toolbox> | |
</tools> | |
</pre></p> | |
<p>This class is only designed for use as a request-scope tool.</p> | |
<P> | |
<P> | |
<DL> | |
<DT><B>Since:</B></DT> | |
<DD>VelocityTools 2.0</DD> | |
<DT><B>Version:</B></DT> | |
<DD>$Id: CookieTool.java 740389 2009-02-03 19:38:36Z nbubna $</DD> | |
<DT><B>Author:</B></DT> | |
<DD><a href="mailto:dim@colebatch.com">Dmitri Colebatch</a>, Nathan Bubna</DD> | |
</DL> | |
<HR> | |
<P> | |
<!-- ======== NESTED CLASS SUMMARY ======== --> | |
<A NAME="nested_class_summary"><!-- --></A> | |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> | |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> | |
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> | |
<B>Nested Class Summary</B></FONT></TH> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>static class</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/CookieTool.SugarCookie.html" title="class in org.apache.velocity.tools.view">CookieTool.SugarCookie</A></B></CODE> | |
<BR> | |
Extends <CODE>Cookie</CODE> to add some fluid API sugar and | |
a toString() method that renders the Cookie's value | |
instead of the usual Object.toString() shenanigans.</TD> | |
</TR> | |
</TABLE> | |
<!-- =========== FIELD SUMMARY =========== --> | |
<A NAME="field_summary"><!-- --></A> | |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> | |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> | |
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> | |
<B>Field Summary</B></FONT></TH> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>private java.util.List<javax.servlet.http.Cookie></CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/CookieTool.html#jar">jar</A></B></CODE> | |
<BR> | |
</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>protected org.apache.velocity.runtime.log.Log</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/CookieTool.html#log">log</A></B></CODE> | |
<BR> | |
</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>protected javax.servlet.http.HttpServletRequest</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/CookieTool.html#request">request</A></B></CODE> | |
<BR> | |
</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>protected javax.servlet.http.HttpServletResponse</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/CookieTool.html#response">response</A></B></CODE> | |
<BR> | |
</TD> | |
</TR> | |
</TABLE> | |
| |
<!-- ======== CONSTRUCTOR SUMMARY ======== --> | |
<A NAME="constructor_summary"><!-- --></A> | |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> | |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> | |
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> | |
<B>Constructor Summary</B></FONT></TH> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/CookieTool.html#CookieTool()">CookieTool</A></B>()</CODE> | |
<BR> | |
</TD> | |
</TR> | |
</TABLE> | |
| |
<!-- ========== METHOD SUMMARY =========== --> | |
<A NAME="method_summary"><!-- --></A> | |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> | |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> | |
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> | |
<B>Method Summary</B></FONT></TH> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE> java.lang.String</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/CookieTool.html#add(javax.servlet.http.Cookie)">add</A></B>(javax.servlet.http.Cookie c)</CODE> | |
<BR> | |
Adds the specified Cookie to the HttpServletResponse.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE> java.lang.String</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/CookieTool.html#add(java.lang.String, java.lang.String)">add</A></B>(java.lang.String name, | |
java.lang.String value)</CODE> | |
<BR> | |
Adds a new Cookie with the specified name and value | |
to the HttpServletResponse.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE> java.lang.String</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/CookieTool.html#add(java.lang.String, java.lang.String, java.lang.Object)">add</A></B>(java.lang.String name, | |
java.lang.String value, | |
java.lang.Object maxAge)</CODE> | |
<BR> | |
Convenience method to add a new Cookie to the response | |
and set an expiry time for it.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE> javax.servlet.http.Cookie</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/CookieTool.html#create(java.lang.String, java.lang.String)">create</A></B>(java.lang.String name, | |
java.lang.String value)</CODE> | |
<BR> | |
Creates a new Cookie with the specified name and value.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE> javax.servlet.http.Cookie</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/CookieTool.html#create(java.lang.String, java.lang.String, java.lang.Object)">create</A></B>(java.lang.String name, | |
java.lang.String value, | |
java.lang.Object maxAge)</CODE> | |
<BR> | |
Convenience method to create a new Cookie | |
and set an expiry time for it.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE> java.lang.String</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/CookieTool.html#delete(java.lang.String)">delete</A></B>(java.lang.String name)</CODE> | |
<BR> | |
Retrieves the specified cookie and sets the Max-Age to 0 | |
to tell the browser to delete the cookie.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE> javax.servlet.http.Cookie</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/CookieTool.html#get(java.lang.String)">get</A></B>(java.lang.String name)</CODE> | |
<BR> | |
Returns the Cookie with the specified name, if it exists.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE> java.util.List<javax.servlet.http.Cookie></CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/CookieTool.html#getAll()">getAll</A></B>()</CODE> | |
<BR> | |
Expose array of Cookies for this request to the template.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE> void</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/CookieTool.html#setLog(org.apache.velocity.runtime.log.Log)">setLog</A></B>(org.apache.velocity.runtime.log.Log log)</CODE> | |
<BR> | |
Sets the <CODE>Log</CODE> used for logging messages when Cookie | |
creation fails due to an invalid name.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE> void</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/CookieTool.html#setRequest(javax.servlet.http.HttpServletRequest)">setRequest</A></B>(javax.servlet.http.HttpServletRequest request)</CODE> | |
<BR> | |
Sets the current <CODE>HttpServletRequest</CODE>.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE> void</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/CookieTool.html#setResponse(javax.servlet.http.HttpServletResponse)">setResponse</A></B>(javax.servlet.http.HttpServletResponse response)</CODE> | |
<BR> | |
Sets the current <CODE>HttpServletResponse</CODE>.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE> java.lang.String</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/CookieTool.html#toString()">toString</A></B>()</CODE> | |
<BR> | |
</TD> | |
</TR> | |
</TABLE> | |
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> | |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> | |
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> | |
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD> | |
</TR> | |
</TABLE> | |
| |
<P> | |
<!-- ============ FIELD DETAIL =========== --> | |
<A NAME="field_detail"><!-- --></A> | |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> | |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> | |
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> | |
<B>Field Detail</B></FONT></TH> | |
</TR> | |
</TABLE> | |
<A NAME="request"><!-- --></A><H3> | |
request</H3> | |
<PRE> | |
protected javax.servlet.http.HttpServletRequest <B>request</B></PRE> | |
<DL> | |
<DL> | |
</DL> | |
</DL> | |
<HR> | |
<A NAME="response"><!-- --></A><H3> | |
response</H3> | |
<PRE> | |
protected javax.servlet.http.HttpServletResponse <B>response</B></PRE> | |
<DL> | |
<DL> | |
</DL> | |
</DL> | |
<HR> | |
<A NAME="log"><!-- --></A><H3> | |
log</H3> | |
<PRE> | |
protected org.apache.velocity.runtime.log.Log <B>log</B></PRE> | |
<DL> | |
<DL> | |
</DL> | |
</DL> | |
<HR> | |
<A NAME="jar"><!-- --></A><H3> | |
jar</H3> | |
<PRE> | |
private java.util.List<javax.servlet.http.Cookie> <B>jar</B></PRE> | |
<DL> | |
<DL> | |
</DL> | |
</DL> | |
<!-- ========= CONSTRUCTOR DETAIL ======== --> | |
<A NAME="constructor_detail"><!-- --></A> | |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> | |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> | |
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> | |
<B>Constructor Detail</B></FONT></TH> | |
</TR> | |
</TABLE> | |
<A NAME="CookieTool()"><!-- --></A><H3> | |
CookieTool</H3> | |
<PRE> | |
public <B>CookieTool</B>()</PRE> | |
<DL> | |
</DL> | |
<!-- ============ METHOD DETAIL ========== --> | |
<A NAME="method_detail"><!-- --></A> | |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> | |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> | |
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> | |
<B>Method Detail</B></FONT></TH> | |
</TR> | |
</TABLE> | |
<A NAME="setRequest(javax.servlet.http.HttpServletRequest)"><!-- --></A><H3> | |
setRequest</H3> | |
<PRE> | |
public void <B>setRequest</B>(javax.servlet.http.HttpServletRequest request)</PRE> | |
<DL> | |
<DD>Sets the current <CODE>HttpServletRequest</CODE>. This is required | |
for this tool to operate and will throw a NullPointerException | |
if this is not set or is set to <code>null</code>. | |
<P> | |
<DD><DL> | |
</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="setResponse(javax.servlet.http.HttpServletResponse)"><!-- --></A><H3> | |
setResponse</H3> | |
<PRE> | |
public void <B>setResponse</B>(javax.servlet.http.HttpServletResponse response)</PRE> | |
<DL> | |
<DD>Sets the current <CODE>HttpServletResponse</CODE>. This is required | |
for this tool to operate and will throw a NullPointerException | |
if this is not set or is set to <code>null</code>. | |
<P> | |
<DD><DL> | |
</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="setLog(org.apache.velocity.runtime.log.Log)"><!-- --></A><H3> | |
setLog</H3> | |
<PRE> | |
public void <B>setLog</B>(org.apache.velocity.runtime.log.Log log)</PRE> | |
<DL> | |
<DD>Sets the <CODE>Log</CODE> used for logging messages when Cookie | |
creation fails due to an invalid name. | |
<P> | |
<DD><DL> | |
</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="getAll()"><!-- --></A><H3> | |
getAll</H3> | |
<PRE> | |
public java.util.List<javax.servlet.http.Cookie> <B>getAll</B>()</PRE> | |
<DL> | |
<DD>Expose array of Cookies for this request to the template. | |
<p>This is equivalent to <code>$request.cookies</code>.</p> | |
<P> | |
<DD><DL> | |
<DT><B>Returns:</B><DD>list of Cookie objects for this request</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="get(java.lang.String)"><!-- --></A><H3> | |
get</H3> | |
<PRE> | |
public javax.servlet.http.Cookie <B>get</B>(java.lang.String name)</PRE> | |
<DL> | |
<DD>Returns the Cookie with the specified name, if it exists. | |
<p>So, if you had a cookie named 'foo', you'd get it's value | |
by <code>$cookies.foo.value</code> or it's max age | |
by <code>$cookies.foo.maxAge</code></p> | |
<P> | |
<DD><DL> | |
</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="add(javax.servlet.http.Cookie)"><!-- --></A><H3> | |
add</H3> | |
<PRE> | |
public java.lang.String <B>add</B>(javax.servlet.http.Cookie c)</PRE> | |
<DL> | |
<DD>Adds the specified Cookie to the HttpServletResponse. | |
This does *not* add the Cookie to the current request. | |
<P> | |
<DD><DL> | |
<DT><B>Parameters:</B><DD><CODE>c</CODE> - is for cookie (that's good enough for me) | |
<DT><B>Returns:</B><DD>an empty String to prevent the reference from rendering | |
unless the cookie passed in is null, then it returns null<DT><B>Since:</B></DT> | |
<DD>VelocityTools 2.0</DD> | |
</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="add(java.lang.String, java.lang.String)"><!-- --></A><H3> | |
add</H3> | |
<PRE> | |
public java.lang.String <B>add</B>(java.lang.String name, | |
java.lang.String value)</PRE> | |
<DL> | |
<DD>Adds a new Cookie with the specified name and value | |
to the HttpServletResponse. This does *not* add a Cookie | |
to the current request. | |
<P> | |
<DD><DL> | |
<DT><B>Parameters:</B><DD><CODE>name</CODE> - the name to give this cookie<DD><CODE>value</CODE> - the value to be set for this cookie | |
<DT><B>Returns:</B><DD>an empty String to prevent the reference from rendering</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="add(java.lang.String, java.lang.String, java.lang.Object)"><!-- --></A><H3> | |
add</H3> | |
<PRE> | |
public java.lang.String <B>add</B>(java.lang.String name, | |
java.lang.String value, | |
java.lang.Object maxAge)</PRE> | |
<DL> | |
<DD>Convenience method to add a new Cookie to the response | |
and set an expiry time for it. | |
<P> | |
<DD><DL> | |
<DT><B>Parameters:</B><DD><CODE>name</CODE> - the name to give this cookie<DD><CODE>value</CODE> - the value to be set for this cookie<DD><CODE>maxAge</CODE> - the expiry to be set for this cookie | |
<DT><B>Returns:</B><DD>an empty String to prevent the reference from rendering</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="create(java.lang.String, java.lang.String)"><!-- --></A><H3> | |
create</H3> | |
<PRE> | |
public javax.servlet.http.Cookie <B>create</B>(java.lang.String name, | |
java.lang.String value)</PRE> | |
<DL> | |
<DD>Creates a new Cookie with the specified name and value. | |
This does *not* add the Cookie to the response, so the | |
created Cookie will not be set unless you do | |
<code>$cookies.add($myCookie)</code>. | |
<P> | |
<DD><DL> | |
<DT><B>Parameters:</B><DD><CODE>name</CODE> - the name to give this cookie<DD><CODE>value</CODE> - the value to be set for this cookie | |
<DT><B>Returns:</B><DD>The new SugarCookie object.<DT><B>Since:</B></DT> | |
<DD>VelocityTools 1.3</DD> | |
</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="create(java.lang.String, java.lang.String, java.lang.Object)"><!-- --></A><H3> | |
create</H3> | |
<PRE> | |
public javax.servlet.http.Cookie <B>create</B>(java.lang.String name, | |
java.lang.String value, | |
java.lang.Object maxAge)</PRE> | |
<DL> | |
<DD>Convenience method to create a new Cookie | |
and set an expiry time for it. | |
<P> | |
<DD><DL> | |
<DT><B>Parameters:</B><DD><CODE>name</CODE> - the name to give this cookie<DD><CODE>value</CODE> - the value to be set for this cookie<DD><CODE>maxAge</CODE> - the expiry to be set for this cookie | |
<DT><B>Returns:</B><DD>The new SugarCookie object.<DT><B>Since:</B></DT> | |
<DD>VelocityTools 1.3</DD> | |
</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="delete(java.lang.String)"><!-- --></A><H3> | |
delete</H3> | |
<PRE> | |
public java.lang.String <B>delete</B>(java.lang.String name)</PRE> | |
<DL> | |
<DD>Retrieves the specified cookie and sets the Max-Age to 0 | |
to tell the browser to delete the cookie. Then this returns | |
an empty string to make this render silently. If no such cookie | |
exists, then it returns null to show the error. | |
<P> | |
<DD><DL> | |
<DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the cookie to be eaten | |
<DT><B>Returns:</B><DD>empty string, or null if no such cookie exists<DT><B>See Also:</B><DD><CODE>Cookie.setMaxAge(int)</CODE>, | |
<A HREF="../../../../../org/apache/velocity/tools/view/CookieTool.html#add(javax.servlet.http.Cookie)"><CODE>add(Cookie)</CODE></A>, | |
<A HREF="../../../../../org/apache/velocity/tools/view/CookieTool.html#get(java.lang.String)"><CODE>get(String)</CODE></A></DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="toString()"><!-- --></A><H3> | |
toString</H3> | |
<PRE> | |
public java.lang.String <B>toString</B>()</PRE> | |
<DL> | |
<DD><DL> | |
<DT><B>Overrides:</B><DD><CODE>toString</CODE> in class <CODE>java.lang.Object</CODE></DL> | |
</DD> | |
<DD><DL> | |
</DL> | |
</DD> | |
</DL> | |
<!-- ========= END OF CLASS DATA ========= --> | |
<HR> | |
<!-- ======= START OF BOTTOM NAVBAR ====== --> | |
<A NAME="navbar_bottom"><!-- --></A> | |
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> | |
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> | |
<TR> | |
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> | |
<A NAME="navbar_bottom_firstrow"><!-- --></A> | |
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> | |
<TR ALIGN="center" VALIGN="top"> | |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> | |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> | |
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> | |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> | |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> | |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> | |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> | |
</TR> | |
</TABLE> | |
</TD> | |
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> | |
</EM> | |
</TD> | |
</TR> | |
<TR> | |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> | |
<A HREF="../../../../../org/apache/velocity/tools/view/BrowserTool.html" title="class in org.apache.velocity.tools.view"><B>PREV CLASS</B></A> | |
<A HREF="../../../../../org/apache/velocity/tools/view/CookieTool.SugarCookie.html" title="class in org.apache.velocity.tools.view"><B>NEXT CLASS</B></A></FONT></TD> | |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> | |
<A HREF="../../../../../index.html?org/apache/velocity/tools/view/CookieTool.html" target="_top"><B>FRAMES</B></A> | |
<A HREF="CookieTool.html" target="_top"><B>NO FRAMES</B></A> | |
<SCRIPT type="text/javascript"> | |
<!-- | |
if(window==top) { | |
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); | |
} | |
//--> | |
</SCRIPT> | |
<NOSCRIPT> | |
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> | |
</NOSCRIPT> | |
</FONT></TD> | |
</TR> | |
<TR> | |
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> | |
SUMMARY: <A HREF="#nested_class_summary">NESTED</A> | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> | |
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> | |
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> | |
</TR> | |
</TABLE> | |
<A NAME="skip-navbar_bottom"></A> | |
<!-- ======== END OF BOTTOM NAVBAR ======= --> | |
<HR> | |
Copyright (c) 2003-2007 Apache Software Foundation | |
</BODY> | |
</HTML> |