Пример #1
0
  /** @see javax.servlet.jsp.tagext.BodyTagSupport#doStartTag() */
  public int doStartTag() throws JspException {
    final String pageAccess = (String) pageContext.getAttribute("access");

    if ((pageAccess != null) && pageAccess.equals(Access.READONLY) && !forceReadWrite) {
      return SKIP_BODY;
    }

    // Recherche si un parent est du bon type
    Tag curParent = null;

    for (curParent = getParent(); (curParent != null) && !(curParent instanceof ColsTag); ) {
      curParent = curParent.getParent();
    }

    if (curParent == null) {
      throw new JspException("ColTag  must be used between Cols Tag.");
    }

    colsTag = (ColsTag) curParent;

    if (!GenericValidator.isBlankOrNull(colsTag.getEmptyKey())
        && (pageContext.getAttribute(colsTag.getId()) == null)) {
      return SKIP_BODY;
    } else {
      return EVAL_PAGE;
    }
  }
Пример #2
0
 protected AbsComponentTag getMyComponentParentTag() {
   Tag tagParent = this.getParent();
   while (tagParent != null) {
     if (tagParent instanceof AbsComponentTag) { // 如果当前父标签是框架的自定义标签
       return (AbsComponentTag) tagParent;
     }
     tagParent = tagParent.getParent();
   }
   return null;
 }
Пример #3
0
  /** @see railo.runtime.ext.tag.TagImpl#doStartTag() */
  public int doStartTag() throws JspException {

    // print.out("do start tag");
    Tag parent = this;
    do {
      parent = parent.getParent();
      if (parent instanceof Chartseries) {
        ((Chartseries) parent).addChartData(data);
        break;
      }
    } while (parent != null);
    return SKIP_BODY;
  }
Пример #4
0
  /** Process the tag. */
  public int doStartTag() throws JspException {
    if (!_hasValueSet) return EVAL_BODY_BUFFERED;

    PageContextImpl pageContext = (PageContextImpl) this.pageContext;

    Object value = _value;

    Tag parent = getParent();
    for (; parent != null && !(parent instanceof SQLExecutionTag); parent = parent.getParent()) {}

    if (parent == null) throw new JspException(L.l("sql:param requires sql:query parent."));

    SQLExecutionTag tag = (SQLExecutionTag) parent;

    tag.addSQLParameter(value);

    return SKIP_BODY;
  }
Пример #5
0
  /** Process the tag. */
  public int doEndTag() throws JspException {
    if (_hasValueSet) return EVAL_PAGE;

    String value;

    if (bodyContent != null) value = bodyContent.getString().trim();
    else value = "";

    Tag parent = getParent();
    for (; parent != null && !(parent instanceof SQLExecutionTag); parent = parent.getParent()) {}

    if (parent == null) throw new JspException(L.l("sql:param requires sql:query parent."));

    SQLExecutionTag tag = (SQLExecutionTag) parent;

    tag.addSQLParameter(value);

    return EVAL_PAGE;
  }