Example usage for javax.servlet.jsp.tagext TryCatchFinally doFinally

List of usage examples for javax.servlet.jsp.tagext TryCatchFinally doFinally

Introduction

In this page you can find the example usage for javax.servlet.jsp.tagext TryCatchFinally doFinally.

Prototype


void doFinally();

Source Link

Document

Invoked in all cases after doEndTag() for any class implementing Tag, IterationTag or BodyTag.

Usage

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

/**
 * Invokes the tag with the provided interceptor. The tag should have been
 * populated with its properties before calling this method. The tag is not
 * released after the tag's lifecycle is over.
 * /*from   w w w  . j a  va2  s .  c o m*/
 * @throws JspException If the tag throws an exception
 * @throws IOException If an error occurs when reading or writing the body
 *         content
 */
public void invoke() throws JspException, IOException {
    if (this.tag instanceof TryCatchFinally) {
        TryCatchFinally tryCatchFinally = (TryCatchFinally) this.tag;
        try {
            invokeInternal();
        } catch (Throwable t1) {
            try {
                tryCatchFinally.doCatch(t1);
            } catch (Throwable t2) {
                throw new JspException(t2.getMessage());
            }
        } finally {
            tryCatchFinally.doFinally();
        }
    } else {
        invokeInternal();
    }
}

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

public void doFinallyProcess() {
    Tag tag = getLoadedTag();/*from   w w w  .  ja  v  a  2 s.com*/
    if (tag instanceof TryCatchFinally) {
        TryCatchFinally tryCatch = (TryCatchFinally) tag;
        try {
            tryCatch.doFinally();
        } finally {
            releaseLoadedTag();
        }
    } else {
        throw new IllegalStateException();
    }
}