public class VerifyCodeUtil
extends java.lang.Object
限定符和类型 | 类和说明 |
---|---|
static class |
VerifyCodeUtil.VCTtype |
构造器和说明 |
---|
VerifyCodeUtil() |
限定符和类型 | 方法和说明 |
---|---|
static boolean |
checkValidCode(java.lang.String vcodekey,
java.lang.String vcode)
校验图形验证码
|
static boolean |
checkValidCode(java.lang.String vcodekey,
java.lang.String vcode,
java.lang.Boolean bRemove)
校验图形验证码
|
static java.lang.String |
getValidCode(java.lang.String vcodekey)
根据vcodekey返回保存在session中的图形验证码
|
static java.lang.String |
getValidCodeKey(java.lang.String vcodekey)
根据vcodekey获取session中图形验证码的key值
|
static java.lang.String |
outputCaptcha(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
VerifyCodeUtil.VCTtype vcTtype)
输出验证码到响应流
|
protected static void |
setResponseHeaders(javax.servlet.http.HttpServletResponse response)
设置 http 相应头信息
|
protected static void setResponseHeaders(javax.servlet.http.HttpServletResponse response)
response
- 相应对象public static java.lang.String outputCaptcha(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, VerifyCodeUtil.VCTtype vcTtype)
request
- 请求对象response
- 相应对象vcTtype
- 类型public static java.lang.String getValidCodeKey(java.lang.String vcodekey)
vcodekey
- 创建图形验证码时传入的UUIDpublic static java.lang.String getValidCode(java.lang.String vcodekey)
vcodekey
- 创建图形验证码时传入的UUIDpublic static boolean checkValidCode(java.lang.String vcodekey, java.lang.String vcode, java.lang.Boolean bRemove)
vcodekey
- 创建图形验证码时传入的UUIDvcode
- 待校验的图形验证码bRemove
- 校验完图形验证码后是否从session中移除public static boolean checkValidCode(java.lang.String vcodekey, java.lang.String vcode)
vcodekey
- 创建图形验证码时传入的UUIDvcode
- 待校验的图形验证码