View Javadoc

1   /*
2    * JCaptcha, the open source java framework for captcha definition and integration
3    * Copyright (c)  2007 jcaptcha.net. All Rights Reserved.
4    * See the LICENSE.txt file distributed with this package.
5    */
6   
7   package com.octo.captcha.module.taglib;
8   
9   import java.io.IOException;
10  
11  /***
12   * <p><ul><li></li></ul></p>
13   *
14   * @author <a href="mailto:mag@jcaptcha.net">Marc-Antoine Garrigue</a>
15   * @version 1.0
16   */
17  public abstract class QuestionTag extends BaseCaptchaTag implements javax.servlet.jsp.tagext.Tag {
18  
19      public int doEndTag() throws javax.servlet.jsp.JspException {
20          String question = getService().getQuestionForID(pageContext.getSession().getId()
21                  , pageContext.getRequest().getLocale());
22  
23          try {
24              pageContext.getOut().write(question);
25          } catch (IOException e) {
26              throw new javax.servlet.jsp.JspException(e);
27          }
28          return javax.servlet.jsp.tagext.Tag.EVAL_PAGE;
29      }
30  
31  
32  }