1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package examples;
18
19 import javax.servlet.jsp.JspException;
20 import javax.servlet.jsp.PageContext;
21 import javax.servlet.jsp.tagext.BodyContent;
22 import javax.servlet.jsp.tagext.BodyTagSupport;
23 import javax.servlet.jsp.tagext.Tag;
24
25 public abstract class ExampleTagBase extends BodyTagSupport {
26
27 public void setParent(Tag parent) {
28 this.parent = parent;
29 }
30
31 public void setBodyContent(BodyContent bodyOut) {
32 this.bodyOut = bodyOut;
33 }
34
35 public void setPageContext(PageContext pageContext) {
36 this.pageContext = pageContext;
37 }
38
39 public Tag getParent() {
40 return this.parent;
41 }
42
43 public int doStartTag() throws JspException {
44 return SKIP_BODY;
45 }
46
47 public int doEndTag() throws JspException {
48 return EVAL_PAGE;
49 }
50
51
52
53
54 public void doInitBody() throws JspException {
55 }
56
57 public int doAfterBody() throws JspException {
58 return SKIP_BODY;
59 }
60
61 public void release() {
62 bodyOut = null;
63 pageContext = null;
64 parent = null;
65 }
66
67 protected BodyContent bodyOut;
68 protected PageContext pageContext;
69 protected Tag parent;
70 }