public class CaptchaRender extends Render
| 限定符和类型 | 字段和说明 |
|---|---|
protected static String |
captchaName |
protected static char[] |
charArray |
protected static int |
HEIGHT |
protected static Random |
random |
protected static Font[] |
RANDOM_FONT |
protected static int |
WIDTH |
| 构造器和说明 |
|---|
CaptchaRender() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected Captcha |
createCaptcha() |
protected void |
drawGraphic(String randomString,
BufferedImage image) |
protected String |
getCaptchaKeyFromCookie() |
protected Color |
getRandColor(int fc,
int bc) |
protected String |
getRandomString() |
void |
render()
生成验证码
|
static void |
setCaptchaName(String captchaName)
设置 captchaName
|
static boolean |
validate(Controller controller,
String userInputString)
校验用户输入的验证码是否正确
|
static boolean |
validate(String captchaKey,
String userInputString)
校验用户输入的验证码是否正确
|
getDevMode, getEncoding, getView, setContext, setContext, setViewprotected static String captchaName
protected static final Random random
protected static final int WIDTH
protected static final int HEIGHT
protected static final char[] charArray
protected static final Font[] RANDOM_FONT
public static void setCaptchaName(String captchaName)
protected Captcha createCaptcha()
protected String getCaptchaKeyFromCookie()
protected String getRandomString()
protected void drawGraphic(String randomString, BufferedImage image)
protected Color getRandColor(int fc, int bc)
public static boolean validate(Controller controller, String userInputString)
controller - 控制器userInputString - 用户输入的字符串Copyright © 2017. All rights reserved.