1 28 29 package com.caucho.jstl.el; 30 31 import com.caucho.el.Expr; 32 import com.caucho.jsp.PageContextImpl; 33 import com.caucho.util.L10N; 34 35 import javax.servlet.jsp.JspException ; 36 import javax.servlet.jsp.jstl.fmt.LocalizationContext; 37 import javax.servlet.jsp.tagext.TagSupport ; 38 39 42 public class SetBundleTag extends TagSupport { 43 private static L10N L = new L10N(SetBundleTag.class); 44 45 private Expr _basenameExpr; 46 private String _var = "javax.servlet.jsp.jstl.fmt.localizationContext"; 47 private String _scope; 48 49 52 public void setBasename(Expr basename) 53 { 54 _basenameExpr = basename; 55 } 56 57 60 public void setVar(String var) 61 { 62 _var = var; 63 } 64 65 68 public void setScope(String scope) 69 { 70 _scope = scope; 71 } 72 73 76 public int doStartTag() 77 throws JspException 78 { 79 PageContextImpl pageContext = (PageContextImpl) this.pageContext; 80 81 String basename = _basenameExpr.evalString(pageContext.getELContext()); 82 83 LocalizationContext bundle = pageContext.getBundle(basename); 84 85 CoreSetTag.setValue(pageContext, _var, _scope, bundle); 86 87 return SKIP_BODY; 88 } 89 } 90 | Popular Tags |