1 16 17 package org.apache.taglibs.standard.tag.el.core; 18 19 import javax.servlet.jsp.JspException ; 20 21 import org.apache.taglibs.standard.tag.common.core.ImportSupport; 22 import org.apache.taglibs.standard.tag.common.core.NullAttributeException; 23 24 30 31 public class ImportTag extends ImportSupport { 32 33 36 private String context_; private String charEncoding_; private String url_; 40 41 44 49 public ImportTag() { 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 69 public void release() { 71 super.release(); 72 init(); 73 } 74 75 76 79 public void setUrl(String url_) { 81 this.url_ = url_; 82 } 83 84 public void setContext(String context_) { 85 this.context_ = context_; 86 } 87 88 public void setCharEncoding(String charEncoding_) { 89 this.charEncoding_ = charEncoding_; 90 } 91 92 95 private void init() { 97 url_ = context_ = charEncoding_ = null; 99 } 100 101 102 private void evaluateExpressions() throws JspException { 103 110 111 url = (String ) ExpressionUtil.evalNotNull( 112 "import", "url", url_, String .class, this, pageContext); 113 if (url == null || url.equals("")) 114 throw new NullAttributeException("import", "url"); 115 116 context = (String ) ExpressionUtil.evalNotNull( 117 "import", "context", context_, String .class, this, pageContext); 118 charEncoding = (String ) ExpressionUtil.evalNotNull( 119 "import", "charEncoding", charEncoding_, String .class, this, 120 pageContext); 121 } 122 } 123 | Popular Tags |