1 16 17 package org.apache.taglibs.mailer; 18 19 import javax.servlet.jsp.JspException ; 20 import javax.servlet.jsp.tagext.BodyContent ; 21 import javax.servlet.jsp.tagext.BodyTagSupport ; 22 23 38 39 public class ReplyToTag extends BodyTagSupport { 40 41 42 53 public int doAfterBody() throws JspException { 54 55 MailTag myparent = (MailTag)findAncestorWithClass(this, MailTag.class); 57 58 if (myparent == null) { 59 throw new JspException ("replyto tag not nested within mail tag"); 60 } 61 62 BodyContent body = getBodyContent(); 63 String replyto = body.getString(); 64 body.clearBody(); 66 if (replyto != null) { 67 replyto.trim(); 68 if (replyto.length() > 0) { 69 myparent.resetReplyTo(replyto); return SKIP_BODY; 71 } 72 } 73 throw new JspException ("The replyto tag is empty"); 74 } 75 } 76 | Popular Tags |