1 25 29 package org.jresearch.gossip.tags.navbar; 30 31 import javax.servlet.jsp.JspException ; 32 import javax.servlet.jsp.tagext.TagSupport ; 33 34 39 public class NavElementTag extends TagSupport { 40 private NavElement navElement; 41 42 50 public int doStartTag() throws JspException { 51 try { 52 this.navElement = new NavElement(); 53 } catch (Exception ex) { 54 throw new JspException ("error in BlockOptionsTag tag:", ex); 55 } 56 57 return (super.EVAL_BODY_INCLUDE); 58 } 59 60 68 public int doEndTag() throws JspException { 69 try { 70 ((NavBarTag) super.findAncestorWithClass(this, NavBarTag.class)) 71 .addNavElement(this.navElement); 72 } catch (Exception ex) { 73 throw new JspException ("error in BlockOptionsTag tag:", ex); 74 } 75 76 return (super.EVAL_PAGE); 77 } 78 79 84 public void setLink(String string) { 85 this.navElement.setLink(string); 86 } 87 88 93 public void setTitle(String string) { 94 this.navElement.setTitle(string); 95 } 96 } 97 | Popular Tags |