1 53 54 106 107 package com.Yasna.forum.tags; 108 109 import java.io.*; 110 import javax.servlet.*; 111 import javax.servlet.jsp.*; 112 import javax.servlet.jsp.tagext.*; 113 import javax.servlet.http.*; 114 import com.Yasna.forum.tags.*; 115 116 138 139 public class PostAppendTag extends BodyTagSupport 140 { 141 142 147 public final int doStartTag() throws JspException 148 { 149 return EVAL_BODY_TAG; 150 } 151 152 158 public final int doAfterBody() throws JspException 159 { 160 PostTag pt = null; 162 try { 163 pt = (PostTag)this.findAncestorWithClass(this, 164 Class.forName("com.Yasna.forum.tags.PostTag")); 165 } catch(Exception e) { 166 } 167 168 if( pt == null ) { 170 throw new JspException("Yazd post_forum tag must be nested inside a post tag"); 171 } 172 173 BodyContent body = getBodyContent(); 175 String s = body.getString(); 176 body.clearBody(); 178 179 pt.appendBody(s); 181 182 return SKIP_BODY; 183 } 184 185 } 186 | Popular Tags |