|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.jsp.tagext.TagSupport
org.apache.taglibs.response.AddCookieTag
public class AddCookieTag
JSP Tag addCookie, used to add a cookie to the Http Response.
The script variable for the name of the cookie is required.
Cookie attributes such as the comment, value, etc. can be set statically by using the corresponding addCookie tag attribute. Or dynamically using the corresponding tag in the body of the addCookie tag.
JSP Tag Lib Descriptor
<name>addCookie</name> <tagclass>org.apache.taglibs.response.AddCookieTag</tagclass> <bodycontent>JSP</bodycontent> <info>Add a cookie to an Http Response.</info> <attribute> <name>name</name> <required>true</required> <rtexprvalue>false</rtexprvalue> </attribute> <attribute> <name>value</name> <required>false</required> <rtexprvalue>false</rtexprvalue> </attribute> <attribute> <name>comment</name> <required>false</required> <rtexprvalue>false</rtexprvalue> </attribute> <attribute> <name>domain</name> <required>false</required> <rtexprvalue>false</rtexprvalue> </attribute> <attribute> <name>maxAge</name> <required>false</required> <rtexprvalue>false</rtexprvalue> </attribute> <attribute> <name>path</name> <required>false</required> <rtexprvalue>false</rtexprvalue> </attribute> <attribute> <name>secure</name> <required>false</required> <rtexprvalue>false</rtexprvalue> </attribute> <attribute> <name>version</name> <required>false</required> <rtexprvalue>false</rtexprvalue> </attribute>
Field Summary |
---|
Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
id, pageContext |
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag |
---|
EVAL_BODY_AGAIN |
Fields inherited from interface javax.servlet.jsp.tagext.Tag |
---|
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
Constructor Summary | |
---|---|
AddCookieTag()
|
Method Summary | |
---|---|
int |
doEndTag()
Method called at end of Tag used to set cookie attributes and add the cookie to the Http Response. |
int |
doStartTag()
Method called at start of addCookie tag to create cookie |
void |
setComment(java.lang.String com)
Optional attribute, specifies a comment that describes a cookie's purpose. |
void |
setDomain(java.lang.String dom)
Optional attribute, specifies the domain within which this cookie should be presented. |
void |
setMaxAge(int max)
Optional attribute, sets the maximum age of the cookie in seconds. |
void |
setName(java.lang.String nam)
Required attribute, name of the cookie. |
void |
setPath(java.lang.String pth)
Optional attribute, specifies a path for the cookie to which the client should return the cookie. |
void |
setSecure(boolean flag)
Optional attribute, indicates to the browser whether the cookie should only be sent using a secure protocol, such as HTTPS or SSL. |
void |
setValue(java.lang.String val)
Optional attribute, assigns a value to a cookie. |
void |
setVersion(int version)
Optional attribute, sets the version of the cookie protocol this cookie complies with. |
Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AddCookieTag()
Method Detail |
---|
public final int doStartTag() throws javax.servlet.jsp.JspException
doStartTag
in interface javax.servlet.jsp.tagext.Tag
doStartTag
in class javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.JspException
public final int doEndTag() throws javax.servlet.jsp.JspException
doEndTag
in interface javax.servlet.jsp.tagext.Tag
doEndTag
in class javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.JspException
public final void setComment(java.lang.String com)
String
- commentpublic final void setDomain(java.lang.String dom)
String
- domainpublic final void setMaxAge(int max)
String
- number of secondspublic final void setName(java.lang.String nam)
String
- namepublic final void setPath(java.lang.String pth)
String
- pathpublic final void setValue(java.lang.String val)
String
- valuepublic final void setSecure(boolean flag)
String
- true or falsepublic final void setVersion(int version)
int
- version number
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |