Forums Register Login
exception in doAfterBody
Hi ranchers,

Let's say there is an exception occured in doAfterBody of IterationTag implementation and it doesnt try-catched, would the doEndTag still be called by the container?
Hello Hendy,

I believe the short answer is no.

The following is copied from the javadoc of the TryCatchFinally interface, an auxiliary interface that a Tag, an IterationTag or a BodyTag can implement. doAfterBody should be called somewhere between doStartTag and doEndTag, so any exceptions here will cause doEndTag to be skipped.

This is also supported by the JSP 2.0 spec, page 2-52, The Tag Interface.

If an exception is encountered during the evaluation of the body of a tag, its doEndTag method will not be evaluated. See the TryCatchFinally tag for methods that are guaranteed to be evaluated.

Thanks, Dagbj�rn
Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards

This thread has been viewed 354 times.

All times above are in ranch (not your local) time.
The current ranch time is
Feb 25, 2018 20:22:49.