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