Rev 960 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
956 | dev | 1 | package ak.backpath.taglib; |
2 | |||
3 | import javax.servlet.http.HttpServletRequest; |
||
4 | import javax.servlet.jsp.JspException; |
||
5 | import javax.servlet.jsp.tagext.TagSupport; |
||
6 | import ak.backpath.BackPath; |
||
7 | |||
8 | public abstract class EmptyTagBase extends TagSupport |
||
9 | { |
||
10 | protected String backPathKey = BackPath.DEFAULT_KEY; |
||
11 | |||
12 | public String getBackPathKey() |
||
13 | { |
||
14 | return this.backPathKey; |
||
15 | } |
||
16 | |||
17 | public void setBackPathKey(String backPathKey) |
||
18 | { |
||
19 | this.backPathKey = backPathKey; |
||
20 | } |
||
21 | |||
22 | protected String backPathParam = BackPath.DEFAULT_PARAM; |
||
23 | |||
24 | public String getBackPathParam() |
||
25 | { |
||
26 | return this.backPathParam; |
||
27 | } |
||
28 | |||
29 | public void setBackPathParam(String backPathParam) |
||
30 | { |
||
31 | this.backPathParam = backPathParam; |
||
32 | } |
||
33 | |||
34 | protected String backPathIgnore = null; |
||
35 | |||
36 | public String getBackPathIgnore() |
||
37 | { |
||
38 | return this.backPathIgnore; |
||
39 | } |
||
40 | |||
41 | public void setBackPathIgnore(String backPathIgnore) |
||
42 | { |
||
43 | this.backPathIgnore = backPathIgnore; |
||
44 | } |
||
45 | |||
46 | protected boolean zip = BackPath.DEFAULT_ZIP; |
||
47 | |||
48 | public boolean getZip() |
||
49 | { |
||
50 | return this.zip; |
||
51 | } |
||
52 | |||
53 | public void setZip(boolean zip) |
||
54 | { |
||
55 | this.zip = zip; |
||
56 | } |
||
57 | |||
58 | public void release() |
||
59 | { |
||
60 | super.release(); |
||
61 | backPathKey = BackPath.DEFAULT_KEY; |
||
62 | backPathParam = BackPath.DEFAULT_PARAM; |
||
63 | backPathIgnore = null; |
||
64 | zip = BackPath.DEFAULT_ZIP; |
||
65 | } |
||
66 | |||
67 | public int doStartTag() throws JspException |
||
68 | { |
||
1026 | dev | 69 | if(condition()) |
956 | dev | 70 | return (EVAL_BODY_INCLUDE); |
71 | else |
||
72 | return (SKIP_BODY); |
||
73 | } |
||
74 | |||
75 | public int doEndTag() throws JspException |
||
76 | { |
||
77 | return (EVAL_PAGE); |
||
78 | } |
||
79 | |||
80 | protected abstract boolean condition() throws JspException; |
||
81 | |||
82 | protected BackPath findBackPath() throws JspException |
||
83 | { |
||
84 | return TaglibUtils.findBackPath(pageContext, backPathKey, |
||
85 | backPathParam, backPathIgnore, zip); |
||
86 | } |
||
87 | } |