1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package org.apache.tiles.jsp.taglib;
22
23 import javax.servlet.jsp.tagext.BodyTagSupport;
24 import javax.servlet.jsp.tagext.TryCatchFinally;
25
26 /***
27 * An abstract common base class to extend for all Tiles JSP tag handlers which
28 * access body content. Defines useful life cycle extension points.
29 *
30 * @version $Rev: 727708 $ $Date: 2008-12-18 13:36:35 +0100 (gio, 18 dic 2008) $
31 * @since 2.1.1
32 */
33 public abstract class TilesBodyTag extends BodyTagSupport implements
34 TryCatchFinally {
35
36 /***
37 * Default no-op implementation, but overrideable if needed.
38 *
39 * @param throwable The throwable object.
40 * @throws Throwable The throwable object itself, by default.
41 * @see TryCatchFinally#doCatch(Throwable)
42 */
43 public void doCatch(Throwable throwable) throws Throwable {
44 throw throwable;
45 }
46
47 /***
48 * Called after doEndTag(). This common implementation calls reset() to
49 * release any per-invocation resources.
50 *
51 * @see TryCatchFinally#doFinally()
52 */
53 public void doFinally() {
54 reset();
55 }
56
57 /***
58 * Release any per-invocation resources, resetting any resources or state
59 * that should be cleared between successive invocations of
60 * {@link javax.servlet.jsp.tagext.Tag#doEndTag()} and
61 * {@link javax.servlet.jsp.tagext.Tag#doStartTag()}.
62 */
63 protected void reset() {
64 }
65
66 /***
67 * Release any per-instance resources, releasing any resources or state
68 * before this tag instance is disposed.
69 *
70 * @see javax.servlet.jsp.tagext.Tag#release()
71 */
72 @Override
73 public void release() {
74 super.release();
75 reset();
76 }
77
78 }