类 CaptchaUtil
java.lang.Object
io.springboot.captcha.utils.AbstractCaptchaUtil
io.springboot.captcha.utils.CaptchaUtil
图形验证码工具类
- 从以下版本开始:
- 2018-07-27 上午 10:08
- 作者:
- 王帆
-
字段概要
从类继承的字段 io.springboot.captcha.utils.AbstractCaptchaUtil
DEFAULT_HEIGHT, DEFAULT_LEN, DEFAULT_WIDTH, SESSION_KEY -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static voidclear(javax.servlet.http.HttpServletRequest request) 清除session中的验证码static voidout(int width, int height, int len, int type, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) 输出验证码static voidout(int width, int height, int len, Font font, int type, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) 输出验证码static voidout(int width, int height, int len, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) 输出验证码static voidout(int len, Font font, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) 输出验证码static voidout(int len, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) 输出验证码static voidout(Captcha captcha, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) 输出验证码static voidout(Font font, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) 输出验证码static voidout(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) 输出验证码static voidsetHeader(javax.servlet.http.HttpServletResponse response) 设置相应头static boolean验证验证码
-
构造器详细资料
-
CaptchaUtil
public CaptchaUtil()
-
-
方法详细资料
-
out
public static void out(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException 输出验证码- 参数:
request- HttpServletRequestresponse- HttpServletResponse- 抛出:
IOException- IO异常
-
out
public static void out(int len, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException 输出验证码- 参数:
len- 长度request- HttpServletRequestresponse- HttpServletResponse- 抛出:
IOException- IO异常
-
out
public static void out(int width, int height, int len, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException 输出验证码- 参数:
width- 宽度height- 高度len- 长度request- HttpServletRequestresponse- HttpServletResponse- 抛出:
IOException- IO异常
-
out
public static void out(Font font, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException 输出验证码- 参数:
font- 字体request- HttpServletRequestresponse- HttpServletResponse- 抛出:
IOException- IO异常
-
out
public static void out(int len, Font font, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException 输出验证码- 参数:
len- 长度font- 字体request- HttpServletRequestresponse- HttpServletResponse- 抛出:
IOException- IO异常
-
out
public static void out(int width, int height, int len, Font font, int type, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException 输出验证码- 参数:
width- 宽度height- 高度len- 长度font- 字体type- 验证码字符类型request- HttpServletRequestresponse- HttpServletResponse- 抛出:
IOException- IO异常
-
out
public static void out(int width, int height, int len, int type, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException 输出验证码- 参数:
width- 宽度height- 高度len- 长度type- 验证码字符类型request- HttpServletRequestresponse- HttpServletResponse- 抛出:
IOException- IO异常
-
out
public static void out(Captcha captcha, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException 输出验证码- 参数:
captcha- Captcharequest- HttpServletRequestresponse- HttpServletResponse- 抛出:
IOException- IO异常
-
ver
验证验证码- 参数:
code- 用户输入的验证码request- HttpServletRequest- 返回:
- 是否正确
-
clear
public static void clear(javax.servlet.http.HttpServletRequest request) 清除session中的验证码- 参数:
request- HttpServletRequest
-
setHeader
public static void setHeader(javax.servlet.http.HttpServletResponse response) 设置相应头- 参数:
response- HttpServletResponse
-