javax.servlet.jsp.tagext

Interface TryCatchFinally

  • All Known Implementing Classes:
    LoopTagSupport

    public interface TryCatchFinally
    The auxiliary interface of a Tag, IterationTag or BodyTag tag handler that wants additional hooks for managing resources.

    This interface provides two new methods: doCatch(Throwable) and doFinally(). The prototypical invocation is as follows:

     h = get a Tag();  // get a tag handler, perhaps from pool
    
     h.setPageContext(pc);  // initialize as desired
     h.setParent(null);
     h.setFoo("foo");
     
     // tag invocation protocol; see Tag.java
     try {
       doStartTag()...
       ....
       doEndTag()...
     } catch (Throwable t) {
       // react to exceptional condition
       h.doCatch(t);
     } finally {
       // restore data invariants and release per-invocation resources
       h.doFinally();
     }
     
     ... other invocations perhaps with some new setters
     ...
     h.release();  // release long-term resources
     
    • Method Detail

      • doCatch

        void doCatch(Throwable t)
              throws Throwable
        Invoked if a Throwable occurs while evaluating the BODY inside a tag or in any of the following methods: Tag.doStartTag(), Tag.doEndTag(), IterationTag.doAfterBody() and BodyTag.doInitBody().

        This method is not invoked if the Throwable occurs during one of the setter methods.

        This method may throw an exception (the same or a new one) that will be propagated further up the nest chain. If an exception is thrown, doFinally() will be invoked.

        This method is intended to be used to respond to an exceptional condition.

        Parameters:
        t - The throwable exception navigating through this tag.
        Throws:
        Throwable - if the exception is to be rethrown further up the nest chain.
      • doFinally

        void doFinally()
        Invoked in all cases after doEndTag() for any class implementing Tag, IterationTag or BodyTag. This method is invoked even if an exception has occurred in the BODY of the tag, or in any of the following methods: Tag.doStartTag(), Tag.doEndTag(), IterationTag.doAfterBody() and BodyTag.doInitBody().

        This method is not invoked if the Throwable occurs during one of the setter methods.

        This method should not throw an Exception.

        This method is intended to maintain per-invocation data integrity and resource management actions.

Deutsche Übersetzung

Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.

Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.

Vielen Dank im Voraus.

Dokument erstellt 11/06/2005, zuletzt geändert 18/08/2025
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/java-api-javaee-rf-javax/servlet/jsp/tagext/TryCatchFinally.html

Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.

Referenzen

  1. Zeigen Sie - html-Dokument Sprache des Dokuments:fr Manuel PHP : https://docs.oracle.com, TryCatchFinally (Java(TM) EE 7 Specification APIs)

Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor dieser Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.