1 25 29 package org.jresearch.gossip.tags.navbar; 30 31 import java.util.ArrayList ; 32 33 import javax.servlet.jsp.JspException ; 34 import javax.servlet.jsp.tagext.TagSupport ; 35 36 41 public class NavBarTag extends TagSupport { 42 private String id; 43 44 private ArrayList navElements; 45 46 54 public int doStartTag() throws JspException { 55 try { 56 this.navElements = new ArrayList (); 57 } catch (Exception ex) { 58 throw new JspException ("error in BlockOptionsTag tag:", ex); 59 } 60 61 return (super.EVAL_BODY_INCLUDE); 62 } 63 64 72 public int doEndTag() throws JspException { 73 try { 74 pageContext.setAttribute(id, this.navElements); 75 } catch (Exception ex) { 76 throw new JspException ("error in BlockOptionsTag tag:", ex); 77 } 78 79 return (super.EVAL_PAGE); 80 } 81 82 88 public void addNavElement(NavElement nav) { 89 this.navElements.add(nav); 90 } 91 92 97 public String getId() { 98 return id; 99 } 100 101 106 public void setId(String string) { 107 id = string; 108 } 109 } 110 | Popular Tags |