1 16 17 package org.apache.taglibs.standard.tag.el.fmt; 18 19 import javax.servlet.jsp.JspException ; 20 import javax.servlet.jsp.jstl.fmt.LocalizationContext; 21 22 import org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager; 23 import org.apache.taglibs.standard.tag.common.fmt.MessageSupport; 24 25 31 32 public class MessageTag extends MessageSupport { 33 34 37 private String key_; private String bundle_; 40 41 44 49 public MessageTag() { 50 super(); 51 init(); 52 } 53 54 55 58 public int doStartTag() throws JspException { 60 61 evaluateExpressions(); 63 64 return super.doStartTag(); 66 } 67 68 public void release() { 70 super.release(); 71 init(); 72 } 73 74 75 78 public void setKey(String key_) { 80 this.key_ = key_; 81 this.keySpecified = true; 82 } 83 84 public void setBundle(String bundle_) { 86 this.bundle_ = bundle_; 87 this.bundleSpecified = true; 88 } 89 90 91 94 private void init() { 96 key_ = bundle_ = null; 98 } 99 100 private void evaluateExpressions() throws JspException { 102 109 110 if (keySpecified) { 111 keyAttrValue = (String ) ExpressionEvaluatorManager.evaluate( 112 "key", key_, String .class, this, pageContext); 113 } 114 115 if (bundleSpecified) { 116 bundleAttrValue = (LocalizationContext) 117 ExpressionEvaluatorManager.evaluate( 118 "bundle", bundle_, LocalizationContext.class, this, 119 pageContext); 120 } 121 } 122 } 123 | Popular Tags |