1 16 17 package org.apache.taglibs.response; 18 19 import java.util.*; 20 import javax.servlet.*; 21 import javax.servlet.http.*; 22 import javax.servlet.jsp.*; 23 import javax.servlet.jsp.tagext.*; 24 25 42 43 public class CookieDomainTag extends BodyTagSupport 44 { 45 46 51 public final int doStartTag() throws JspException 52 { 53 return EVAL_BODY_TAG; 54 } 55 56 61 public final int doAfterBody() throws JspException 62 { 63 BodyContent body = getBodyContent(); 65 String s = body.getString().trim(); 66 body.clearBody(); 69 70 AddCookieTag ac = null; 72 try { 73 ac = (AddCookieTag)this.findAncestorWithClass(this, 74 Class.forName("org.apache.taglibs.response.AddCookieTag")); 75 } catch(Exception e) { 76 throw new JspException("Response domain tag must be nested inside an addCookie tag."); 77 } 78 79 ac.setDomain(s); 81 82 return SKIP_BODY; 83 } 84 } 85 | Popular Tags |