FileDocCategorySizeDatePackage
ClassicAddCookieTag.javaAPI DocExample1872Tue Feb 28 11:34:06 GMT 2006com.ora.jsp.tags.xmp

ClassicAddCookieTag

public class ClassicAddCookieTag extends TagSupport
This class is a custom action for adding a cookie header to the response.
author
Hans Bergsten, Gefion software
version
2.0

(Omit source code)

Fields Summary
private String
name
private String
value
private String
maxAgeString
Constructors Summary
Methods Summary
public intdoEndTag()
Creates a cookie and adds it to the response

        int maxAge = -1;
        if (maxAgeString != null) {
	    try {
		maxAge = Integer.valueOf(maxAgeString).intValue();
	    }
	    catch (NumberFormatException e) {
		throw new JspTagException("Invalid maxAge", e);
	    }
        }
        CookieUtils.sendCookie(name, value, maxAge,
            (HttpServletResponse) pageContext.getResponse());
        return EVAL_PAGE;
    
public voidrelease()
Releases all instance variables.

        name = null;
        value = null;
        maxAgeString = null;
        super.release();
    
public voidsetMaxAge(java.lang.String maxAgeString)
Sets the cookie maxAge attribute.

param
maxAgeString the max age (in seconds) of the cookie

        this.maxAgeString = maxAgeString;
    
public voidsetName(java.lang.String name)
Sets the cookie name attribute.

param
name the name of the cookie

        this.name = name;
    
public voidsetValue(java.lang.String value)
Sets the cookie value attribute.

param
value the value of the cookie

        this.value = value;