| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (1.8.0_181) on Wed Oct 10 00:41:13 CEST 2018 --> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <title>CookieTool (VelocityTools 3.0 API)</title> |
| <meta name="date" content="2018-10-10"> |
| <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> |
| <script type="text/javascript" src="../../../../../script.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="CookieTool (VelocityTools 3.0 API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10}; |
| var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; |
| var altColor = "altColor"; |
| var rowColor = "rowColor"; |
| var tableTab = "tableTab"; |
| var activeTableTab = "activeTableTab"; |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a name="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a name="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/CookieTool.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../../../../org/apache/velocity/tools/view/BrowserToolDeprecatedMethods.html" title="class in org.apache.velocity.tools.view"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../../../org/apache/velocity/tools/view/CookieTool.SugarCookie.html" title="class in org.apache.velocity.tools.view"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../index.html?org/apache/velocity/tools/view/CookieTool.html" target="_top">Frames</a></li> |
| <li><a href="CookieTool.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li><a href="#nested.class.summary">Nested</a> | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field.detail">Field</a> | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="subTitle">org.apache.velocity.tools.view</div> |
| <h2 title="Class CookieTool" class="title">Class CookieTool</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li> |
| <li> |
| <ul class="inheritance"> |
| <li><a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html" title="class in org.apache.velocity.tools.generic">org.apache.velocity.tools.generic.SafeConfig</a></li> |
| <li> |
| <ul class="inheritance"> |
| <li>org.apache.velocity.tools.view.CookieTool</li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <hr> |
| <br> |
| <pre><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") |
| public class <span class="typeNameLabel">CookieTool</span> |
| extends <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html" title="class in org.apache.velocity.tools.generic">SafeConfig</a></pre> |
| <div class="block"><p>View tool for convenient cookie access and creation.</p> |
| <p>Template example(s):</p> |
| <pre> |
| $cookie.foo |
| $cookie.add("bar",'woogie') |
| </pre> |
| <p>tools.xml configuration:</p> |
| <pre> |
| <tools> |
| <toolbox scope="request"> |
| <tool class="org.apache.velocity.tools.view.CookieTool"/> |
| </toolbox> |
| </tools> |
| </pre> |
| |
| <p>This class is only designed for use as a request-scope tool.</p></div> |
| <dl> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>VelocityTools 2.0</dd> |
| <dt><span class="simpleTagLabel">Version:</span></dt> |
| <dd>$Id: CookieTool.java 1842523 2018-10-01 17:27:15Z cbrisson $</dd> |
| <dt><span class="simpleTagLabel">Author:</span></dt> |
| <dd><a href="mailto:dim@colebatch.com">Dmitri Colebatch</a>, Nathan Bubna</dd> |
| </dl> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ======== NESTED CLASS SUMMARY ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="nested.class.summary"> |
| <!-- --> |
| </a> |
| <h3>Nested Class Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation"> |
| <caption><span>Nested Classes</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Class and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static class </code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/view/CookieTool.SugarCookie.html" title="class in org.apache.velocity.tools.view">CookieTool.SugarCookie</a></span></code> |
| <div class="block">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.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| <!-- =========== FIELD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="field.summary"> |
| <!-- --> |
| </a> |
| <h3>Field Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> |
| <caption><span>Fields</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Field and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected static org.slf4j.Logger</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/view/CookieTool.html#log">log</a></span></code> </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>protected javax.servlet.http.HttpServletRequest</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/view/CookieTool.html#request">request</a></span></code> </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected javax.servlet.http.HttpServletResponse</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/view/CookieTool.html#response">response</a></span></code> </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a name="fields.inherited.from.class.org.apache.velocity.tools.generic.SafeConfig"> |
| <!-- --> |
| </a> |
| <h3>Fields inherited from class org.apache.velocity.tools.generic.<a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html" title="class in org.apache.velocity.tools.generic">SafeConfig</a></h3> |
| <code><a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#LOCK_CONFIG_KEY">LOCK_CONFIG_KEY</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#LOGGER_NAME_KEY">LOGGER_NAME_KEY</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#SAFE_MODE_KEY">SAFE_MODE_KEY</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#USE_CLASS_LOGGER_KEY">USE_CLASS_LOGGER_KEY</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor.summary"> |
| <!-- --> |
| </a> |
| <h3>Constructor Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> |
| <caption><span>Constructors</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colOne" scope="col">Constructor and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/view/CookieTool.html#CookieTool--">CookieTool</a></span>()</code> </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> |
| <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Method and Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/view/CookieTool.html#add-javax.servlet.http.Cookie-">add</a></span>(javax.servlet.http.Cookie c)</code> |
| <div class="block">Adds the specified Cookie to the HttpServletResponse.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/view/CookieTool.html#add-java.lang.String-java.lang.String-">add</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> value)</code> |
| <div class="block">Adds a new Cookie with the specified name and value |
| to the HttpServletResponse.</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/view/CookieTool.html#add-java.lang.String-java.lang.String-java.lang.Object-">add</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> value, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> maxAge)</code> |
| <div class="block">Convenience method to add a new Cookie to the response |
| and set an expiry time for it.</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code>javax.servlet.http.Cookie</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/view/CookieTool.html#create-java.lang.String-java.lang.String-">create</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> value)</code> |
| <div class="block">Creates a new Cookie with the specified name and value.</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code>javax.servlet.http.Cookie</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/view/CookieTool.html#create-java.lang.String-java.lang.String-java.lang.Object-">create</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> value, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> maxAge)</code> |
| <div class="block">Convenience method to create a new Cookie |
| and set an expiry time for it.</div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/view/CookieTool.html#delete-java.lang.String-">delete</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name)</code> |
| <div class="block">Retrieves the specified cookie and sets the Max-Age to 0 |
| to tell the browser to delete the cookie.</div> |
| </td> |
| </tr> |
| <tr id="i6" class="altColor"> |
| <td class="colFirst"><code>javax.servlet.http.Cookie</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/view/CookieTool.html#get-java.lang.String-">get</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name)</code> |
| <div class="block">Returns the Cookie with the specified name, if it exists.</div> |
| </td> |
| </tr> |
| <tr id="i7" class="rowColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><javax.servlet.http.Cookie></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/view/CookieTool.html#getAll--">getAll</a></span>()</code> |
| <div class="block">Expose array of Cookies for this request to the template.</div> |
| </td> |
| </tr> |
| <tr id="i8" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/view/CookieTool.html#setRequest-javax.servlet.http.HttpServletRequest-">setRequest</a></span>(javax.servlet.http.HttpServletRequest request)</code> |
| <div class="block">Sets the current <code>HttpServletRequest</code>.</div> |
| </td> |
| </tr> |
| <tr id="i9" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/view/CookieTool.html#setResponse-javax.servlet.http.HttpServletResponse-">setResponse</a></span>(javax.servlet.http.HttpServletResponse response)</code> |
| <div class="block">Sets the current <code>HttpServletResponse</code>.</div> |
| </td> |
| </tr> |
| <tr id="i10" class="altColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/view/CookieTool.html#toString--">toString</a></span>()</code> </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods.inherited.from.class.org.apache.velocity.tools.generic.SafeConfig"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class org.apache.velocity.tools.generic.<a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html" title="class in org.apache.velocity.tools.generic">SafeConfig</a></h3> |
| <code><a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#configure-java.util.Map-">configure</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#configure-org.apache.velocity.tools.generic.ValueParser-">configure</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#getLog--">getLog</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#initLogger-org.apache.velocity.tools.generic.ValueParser-">initLogger</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#isConfigLocked--">isConfigLocked</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#isSafeMode--">isSafeMode</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#setLockConfig-boolean-">setLockConfig</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#setSafeMode-boolean-">setSafeMode</a></code></li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3> |
| <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ============ FIELD DETAIL =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="field.detail"> |
| <!-- --> |
| </a> |
| <h3>Field Detail</h3> |
| <a name="log"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>log</h4> |
| <pre>protected static org.slf4j.Logger log</pre> |
| </li> |
| </ul> |
| <a name="request"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>request</h4> |
| <pre>protected javax.servlet.http.HttpServletRequest request</pre> |
| </li> |
| </ul> |
| <a name="response"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>response</h4> |
| <pre>protected javax.servlet.http.HttpServletResponse response</pre> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor.detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a name="CookieTool--"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>CookieTool</h4> |
| <pre>public CookieTool()</pre> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ============ METHOD DETAIL ========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a name="setRequest-javax.servlet.http.HttpServletRequest-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setRequest</h4> |
| <pre>public void setRequest(javax.servlet.http.HttpServletRequest request)</pre> |
| <div class="block">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>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>request</code> - servlet request</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="setResponse-javax.servlet.http.HttpServletResponse-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setResponse</h4> |
| <pre>public void setResponse(javax.servlet.http.HttpServletResponse response)</pre> |
| <div class="block">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>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>response</code> - servlet response</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getAll--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getAll</h4> |
| <pre>public <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><javax.servlet.http.Cookie> getAll()</pre> |
| <div class="block">Expose array of Cookies for this request to the template. |
| |
| <p>This is equivalent to <code>$request.cookies</code>.</p></div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>list of Cookie objects for this request</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="get-java.lang.String-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>get</h4> |
| <pre>public javax.servlet.http.Cookie get(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name)</pre> |
| <div class="block">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></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>name</code> - cookie name</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>found cookie or null</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="add-javax.servlet.http.Cookie-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>add</h4> |
| <pre>public <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> add(javax.servlet.http.Cookie c)</pre> |
| <div class="block">Adds the specified Cookie to the HttpServletResponse. |
| This does *not* add the Cookie to the current request.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>c</code> - is for cookie (that's good enough for me)</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>an empty String to prevent the reference from rendering |
| unless the cookie passed in is null, then it returns null</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>VelocityTools 2.0</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="add-java.lang.String-java.lang.String-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>add</h4> |
| <pre>public <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> add(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> value)</pre> |
| <div class="block">Adds a new Cookie with the specified name and value |
| to the HttpServletResponse. This does *not* add a Cookie |
| to the current request.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>name</code> - the name to give this cookie</dd> |
| <dd><code>value</code> - the value to be set for this cookie</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>an empty String to prevent the reference from rendering</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="add-java.lang.String-java.lang.String-java.lang.Object-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>add</h4> |
| <pre>public <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> add(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> value, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> maxAge)</pre> |
| <div class="block">Convenience method to add a new Cookie to the response |
| and set an expiry time for it.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>name</code> - the name to give this cookie</dd> |
| <dd><code>value</code> - the value to be set for this cookie</dd> |
| <dd><code>maxAge</code> - the expiry to be set for this cookie</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>an empty String to prevent the reference from rendering</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="create-java.lang.String-java.lang.String-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>create</h4> |
| <pre>public javax.servlet.http.Cookie create(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> value)</pre> |
| <div class="block">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>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>name</code> - the name to give this cookie</dd> |
| <dd><code>value</code> - the value to be set for this cookie</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>The new SugarCookie object.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>VelocityTools 1.3</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="create-java.lang.String-java.lang.String-java.lang.Object-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>create</h4> |
| <pre>public javax.servlet.http.Cookie create(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> value, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> maxAge)</pre> |
| <div class="block">Convenience method to create a new Cookie |
| and set an expiry time for it.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>name</code> - the name to give this cookie</dd> |
| <dd><code>value</code> - the value to be set for this cookie</dd> |
| <dd><code>maxAge</code> - the expiry to be set for this cookie</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>The new SugarCookie object.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>VelocityTools 1.3</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="delete-java.lang.String-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>delete</h4> |
| <pre>public <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> delete(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name)</pre> |
| <div class="block">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.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>name</code> - the name of the cookie to be eaten</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>empty string, or null if no such cookie exists</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <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></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="toString--"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>toString</h4> |
| <pre>public <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> toString()</pre> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a></code> in class <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| </div> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a name="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a name="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/CookieTool.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../../../../org/apache/velocity/tools/view/BrowserToolDeprecatedMethods.html" title="class in org.apache.velocity.tools.view"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../../../org/apache/velocity/tools/view/CookieTool.SugarCookie.html" title="class in org.apache.velocity.tools.view"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../index.html?org/apache/velocity/tools/view/CookieTool.html" target="_top">Frames</a></li> |
| <li><a href="CookieTool.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li><a href="#nested.class.summary">Nested</a> | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field.detail">Field</a> | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| <p class="legalCopy"><small>Copyright © 2002–2018 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> |
| </body> |
| </html> |