/** Process the tag. */
  public int doStartTag() throws JspException {
    _query.clear();

    JspWriter jspWriter = null;

    try {
      if (_varReader != null) {
        jspWriter = pageContext.pushBody();

        BodyContentImpl body = (BodyContentImpl) pageContext.getOut();

        handleBody(body);

        _reader = body.getReader();

        pageContext.setAttribute(_varReader, _reader);

        return EVAL_BODY_INCLUDE;
      } else return EVAL_BODY_BUFFERED;
    } catch (JspException e) {
      throw e;
    } catch (ServletException e) {
      throw new JspException(e);
    } catch (IOException e) {
      throw new JspException(e);
    } finally {
      if (jspWriter != null) pageContext.popBody();
    }
  }
  /** Process the end tag */
  public int doEndTag() throws JspException {
    if (_varReader != null) {
      this.pageContext.removeAttribute(_varReader);
    } else {
      try {
        JspWriter jspWriter = pageContext.pushBody();

        BodyContentImpl body = (BodyContentImpl) pageContext.getOut();

        handleBody(body);

        if (_var != null) {
          String value = body.getString();

          pageContext.popBody();

          CoreSetTag.setValue(pageContext, _var, _scope, value);
        } else {
          body.writeOut(body.getEnclosingWriter());

          pageContext.popBody();
        }
      } catch (JspException e) {
        throw e;
      } catch (ServletException e) {
        Throwable e1 = e;

        if (e1.getCause() != null) e1 = e1.getCause();

        throw new JspException(e1.getMessage(), e1);
      } catch (Exception e) {
        throw new JspException(e.getMessage(), e);
      }
    }

    return EVAL_PAGE;
  }