1 package fr.improve.struts.taglib.layout.crumb; 2 3 import javax.servlet.jsp.JspException ; 4 import javax.servlet.jsp.tagext.TagSupport ; 5 6 import fr.improve.struts.taglib.layout.util.TagUtils; 7 8 13 public class CrumbTag extends TagSupport { 14 17 protected String link; 18 19 22 protected String key; 23 24 27 protected String target; 28 29 32 protected String bundle; 33 34 public int doStartTag() throws JspException { 35 CrumbImpl lc_crumb = new CrumbImpl(); 36 lc_crumb.setTarget(target); 37 lc_crumb.setLink(link); 38 lc_crumb.setKey(key); 39 lc_crumb.setBundle(bundle); 40 41 StringBuffer buffer = new StringBuffer (); 42 CrumbsTag lc_tag = (CrumbsTag) findAncestorWithClass(this, CrumbsTag.class); 43 if (lc_tag==null) { 44 throw new JspException ("Invalid use of <layout:crumb> tag"); 45 } 46 lc_tag.printCrumb(buffer, lc_crumb); 47 TagUtils.write(pageContext, buffer.toString()); 48 return SKIP_BODY; 49 } 50 55 public java.lang.String getKey() { 56 return key; 57 } 58 63 public java.lang.String getLink() { 64 return link; 65 } 66 71 public java.lang.String getTarget() { 72 return target; 73 } 74 public void release() { 75 super.release(); 76 77 link = null; 78 key = null; 79 target = null; 80 bundle = null; 81 } 82 87 public void setKey(java.lang.String newKey) { 88 key = newKey; 89 } 90 95 public void setLink(java.lang.String newLink) { 96 link = newLink; 97 } 98 103 public void setTarget(java.lang.String newTarget) { 104 target = newTarget; 105 } 106 109 public String getBundle() { 110 return bundle; 111 } 112 113 116 public void setBundle(String bundle) { 117 this.bundle = bundle; 118 } 119 120 } 121 | Popular Tags |