1
2
3
4
5
6
7 package com.octo.captcha.module.taglib;
8
9 import com.octo.captcha.service.CaptchaService;
10
11 import javax.servlet.jsp.JspException;
12 import javax.servlet.jsp.PageContext;
13 import javax.servlet.jsp.tagext.Tag;
14
15 /***
16 * Defines the service for the module.
17 *
18 * @author <a href="mailto:mag@jcaptcha.net">Marc-Antoine Garrigue</a>
19 * @version 1.0
20 */
21 public abstract class BaseCaptchaTag implements Tag {
22
23
24 protected PageContext pageContext;
25
26 protected Tag parent;
27
28
29 public void setPageContext(javax.servlet.jsp.PageContext pageContext) {
30 this.pageContext = pageContext;
31
32 }
33
34 public void setParent(javax.servlet.jsp.tagext.Tag tag) {
35 this.parent = tag;
36 }
37
38 public javax.servlet.jsp.tagext.Tag getParent() {
39 return parent;
40 }
41
42
43 public int doStartTag() throws javax.servlet.jsp.JspException {
44 return javax.servlet.jsp.tagext.Tag.SKIP_BODY;
45 }
46
47 public void release() {
48
49 }
50
51 public abstract int doEndTag() throws JspException;
52
53 protected abstract CaptchaService getService();
54 }