KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tonbeller > jpivot > tags > ChooseQueryTag


1 package com.tonbeller.jpivot.tags;
2
3 import javax.servlet.jsp.JspException JavaDoc;
4 import javax.servlet.jsp.tagext.TagSupport JavaDoc;
5
6 import org.apache.log4j.Logger;
7
8 /**
9  * If you have multiple queries in the session with different <code>queryName</code> attribute,
10  * this tag chooses the visible one.
11  *
12  * @author av
13  * @since 16.02.2005
14  */

15 public class ChooseQueryTag extends TagSupport JavaDoc {
16   String JavaDoc queryName;
17   private static final Logger logger = Logger.getLogger(ChooseQueryTag.class);
18
19   public int doStartTag() throws JspException JavaDoc {
20     OlapModelProxy omp = OlapModelProxy.instance(id, pageContext.getSession());
21     try {
22       omp.showByName(queryName);
23     } catch (Exception JavaDoc e) {
24       logger.error(null, e);
25       throw new JspException JavaDoc(e);
26     }
27     return super.doStartTag();
28   }
29   public void setQueryName(String JavaDoc queryName) {
30     this.queryName = queryName;
31   }
32 }
33
Popular Tags