Example usage for javax.servlet.jsp.tagext IterationTag doAfterBody

List of usage examples for javax.servlet.jsp.tagext IterationTag doAfterBody

Introduction

In this page you can find the example usage for javax.servlet.jsp.tagext IterationTag doAfterBody.

Prototype


int doAfterBody() throws JspException;

Source Link

Document

Process body (re)evaluation.

Usage

From source file:de.micromata.genome.gwiki.page.gspt.TagSupport.java

public static boolean continueAfterBody(ChildPageContext ctx) throws Exception {
    if (ctx.getTagStack().size() == 0)
        return false;
    Pair<Tag, Integer> tt = ctx.getTagStack().lastElement();
    Tag t = tt.getFirst();//from  w w w . ja  v  a 2  s.co m
    boolean ret = false;
    if (t instanceof IterationTag) {
        IterationTag bt = (IterationTag) t;
        int r = bt.doAfterBody();
        ret = javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN == r;
    }
    if (log.isDebugEnabled() == true)
        log.debug("continueAfterBody: " + t.getClass().getName() + ": " + ret);

    return ret;
}

From source file:org.apache.cactus.extension.jsp.JspTagLifecycle.java

/**
 * Internal method to invoke a tag without doing exception handling.
 * /*from   w ww .j  a v a2  s  .  com*/
 * @throws JspException If the tag throws an exception
 * @throws IOException If an error occurs when reading or writing the body
 *         content
 */
private void invokeInternal() throws JspException, IOException {
    int status = this.tag.doStartTag();
    if (this.tag instanceof IterationTag) {
        if (status != Tag.SKIP_BODY) {
            BodyContent body = null;
            try {
                IterationTag iterationTag = (IterationTag) this.tag;
                if ((status == BodyTag.EVAL_BODY_BUFFERED) && (this.tag instanceof BodyTag)) {
                    BodyTag bodyTag = (BodyTag) this.tag;
                    body = pageContext.pushBody();
                    if (log.isDebugEnabled()) {
                        log.debug("Pushed body content [" + body.getString() + "]");
                    }
                    bodyTag.setBodyContent(body);
                    bodyTag.doInitBody();
                }
                int iteration = 0;
                do {
                    fireEvalBody(iteration, body);
                    if (log.isDebugEnabled()) {
                        log.debug("Body evaluated for the [" + iteration + "] time");
                    }
                    status = iterationTag.doAfterBody();
                    iteration++;
                } while (status == IterationTag.EVAL_BODY_AGAIN);
                if (log.isDebugEnabled()) {
                    log.debug("Body skipped");
                }
                fireSkipBody();
            } finally {
                if (body != null) {
                    if (log.isDebugEnabled()) {
                        log.debug("Popping body content [" + body.getString() + "]");
                    }
                    pageContext.popBody();
                    body = null;
                }
            }
        } else {
            if (log.isDebugEnabled()) {
                log.debug("Body skipped");
            }
            fireSkipBody();
        }
    }
    status = tag.doEndTag();
}

From source file:org.seasar.mayaa.impl.engine.processor.JspProcessor.java

public ProcessStatus doAfterChildProcess() {
    Tag tag = getLoadedTag();/*from   ww  w. ja v  a2 s . com*/
    if (tag instanceof IterationTag) {
        IterationTag iterationTag = (IterationTag) tag;
        try {
            int ret = iterationTag.doAfterBody();
            return getProcessStatus(ret, false);
        } catch (JspException e) {
            throw createJspRuntimeException(getOriginalNode(), getInjectedNode(), e);
        }
    }
    throw new IllegalStateException();
}