1 13 package mondrian.web.taglib; 14 15 import javax.servlet.jsp.JspException ; 16 import javax.servlet.jsp.tagext.BodyTagSupport ; 17 18 41 42 public class QueryTag extends BodyTagSupport { 43 44 public QueryTag() { 45 } 46 47 public int doAfterBody() throws JspException { 48 try { 49 ApplResources ar = ApplResources.getInstance(pageContext.getServletContext()); 50 ResultCache rc = ResultCache.getInstance(pageContext.getSession(), pageContext.getServletContext(), name); 51 if (!resultCache || rc.getQuery() == null) { 53 String mdx = getBodyContent().getString(); 54 rc.parse(mdx); 55 } 56 return SKIP_BODY; 57 } 58 catch (Exception e) { 59 e.printStackTrace(); 60 throw new JspException (e); 61 } 62 } 63 64 67 public void setName(String newName) { 68 name = newName; 69 } 70 public String getName() { 71 return name; 72 } 73 77 public void setResultCache(boolean newResultCache) { 78 resultCache = newResultCache; 79 } 80 public boolean isResultCache() { 81 return resultCache; 82 } 83 private String name; 84 private boolean resultCache; 85 } 86 87 | Popular Tags |