1 26 27 package org.objectweb.jonas.webapp.taglib; 28 29 import javax.servlet.jsp.JspException ; 30 import javax.servlet.jsp.tagext.BodyTagSupport ; 31 import javax.servlet.jsp.tagext.Tag ; 32 33 public class PanelTag extends BodyTagSupport { 34 35 37 40 private String body = null; 41 42 44 49 public int doStartTag() 50 throws JspException { 51 this.body = null; 53 return (EVAL_BODY_BUFFERED); 55 } 56 57 62 public int doAfterBody() 63 throws JspException { 64 String data = bodyContent.getString(); 65 if (data != null) { 66 data = data.trim(); 67 if (data.length() > 0) { 68 this.body = data; 69 } 70 } 71 return (SKIP_BODY); 72 } 73 74 79 public int doEndTag() 80 throws JspException { 81 Tag parent = findAncestorWithClass(this, TabsTag.class); 83 if ((parent == null) || !(parent instanceof TabsTag)) { 84 throw new JspException ("Must be nested in a TabsTag instance"); 85 } 86 TabsTag oTabsTag = (TabsTag) parent; 87 88 oTabsTag.setBody(body); 92 93 return (EVAL_PAGE); 94 } 95 96 99 public void release() { 100 this.body = null; 101 } 102 103 } 104 | Popular Tags |