API Overview API Index Package Overview Direct link to this page
JavaOnTracks 0.1.2
  net.jot.web.forms.ui. JOTFormCaptchaField View Javadoc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57

/*
------------------------------------
JavaOnTracks          Thibaut Colar
tcolar-jot AT colar DOT net
Artistic Licence 2.0
http://www.javaontracks.net
------------------------------------
 */
package net.jot.web.forms.ui;

import net.jot.captcha.JOTCaptchaGeneratorInterface;
import net.jot.web.forms.JOTFormConst;

/**
 *
 * @author tcolar
 */
public class JOTFormCaptchaField extends JOTFormTextField
{

    private String captchcaUrl = "";

    public JOTFormCaptchaField(String name, String description, String captchcaServletUrl)
    {
        this(name, description, captchcaServletUrl,null);
    }
    
    /**
     * Generator: the generator that will be used to generate the image, when captchcaUrl is called
     * This is used to show in the help which chars might be used in the captcha
     * @param name
     * @param description
     * @param captchcaServletUrl
     * @param captchaGenerator
     */
    public JOTFormCaptchaField(String name, String description, String captchcaServletUrl, JOTCaptchaGeneratorInterface captchaGenerator)
    {
        super(name, description, 10, "");
        setType(JOTFormConst.INPUT_CAPTCHA);
        this.captchcaUrl = captchcaServletUrl;
        String help="Enter the Letters / Numbers (Left to Right) you see in the image into the text field.";
        
        if(captchaGenerator!=null)
            help+="<br>The code might contain the following Numbers or letters:<br>"+captchaGenerator.getChars();
        setHelp(help);
    }

    public String getCaptchcaUrl()
    {
        return captchcaUrl;
    }

    public void setCaptchcaUrl(String captchcaUrl)
    {
        this.captchcaUrl = captchcaUrl;
    }
}

Generated By: JavaOnTracks Doclet 0.1.5     ©Thibaut Colar