1 10 package org.mmbase.applications.community.taglib; 11 12 import org.mmbase.bridge.jsp.taglib.util.Attribute; 13 14 import javax.servlet.jsp.JspTagException ; 15 import javax.servlet.jsp.JspException ; 16 17 18 import org.mmbase.bridge.Node; 19 20 import org.mmbase.bridge.jsp.taglib.*; 21 22 29 30 public class GetInfoTag extends NodeReferrerTag implements Writer { 31 32 private Attribute key = Attribute.NULL; 33 public void setKey(String k) throws JspTagException { 34 key = getAttribute(k); 35 } 36 37 38 public int doStartTag() throws JspTagException { 39 Node node = getNode(); 41 42 String k; 43 if (key == Attribute.NULL) { 45 k = "name"; 46 } else { 47 k = key.getString(this); 48 } 49 String value = node.getStringValue("getinfovalue(" + k + ")"); 50 if (value == null) value = ""; 51 52 helper.setValue(value); 53 helper.useEscaper(false); if (getId() != null) { 55 getContextProvider().getContextContainer().register(getId(), helper.getValue()); 56 } 57 return EVAL_BODY_BUFFERED; 58 } 59 60 61 64 public int doEndTag() throws JspTagException { 65 return helper.doEndTag(); 66 } 67 68 public int doAfterBody() throws JspException { 69 return helper.doAfterBody(); 70 } 71 } 72 | Popular Tags |