类 CaptchaUtil

java.lang.Object
io.springboot.captcha.utils.AbstractCaptchaUtil
io.springboot.captcha.utils.CaptchaUtil

public class CaptchaUtil extends AbstractCaptchaUtil
图形验证码工具类
从以下版本开始:
2018-07-27 上午 10:08
作者:
王帆
  • 字段概要

    从类继承的字段 io.springboot.captcha.utils.AbstractCaptchaUtil

    DEFAULT_HEIGHT, DEFAULT_LEN, DEFAULT_WIDTH, SESSION_KEY
  • 构造器概要

    构造器
    构造器
    说明
     
  • 方法概要

    修饰符和类型
    方法
    说明
    static void
    clear(javax.servlet.http.HttpServletRequest request)
    清除session中的验证码
    static void
    out(int width, int height, int len, int type, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
    输出验证码
    static void
    out(int width, int height, int len, Font font, int type, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
    输出验证码
    static void
    out(int width, int height, int len, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
    输出验证码
    static void
    out(int len, Font font, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
    输出验证码
    static void
    out(int len, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
    输出验证码
    static void
    out(Captcha captcha, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
    输出验证码
    static void
    out(Font font, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
    输出验证码
    static void
    out(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
    输出验证码
    static void
    setHeader(javax.servlet.http.HttpServletResponse response)
    设置相应头
    static boolean
    ver(String code, javax.servlet.http.HttpServletRequest request)
    验证验证码

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 构造器详细资料

    • CaptchaUtil

      public CaptchaUtil()
  • 方法详细资料

    • out

      public static void out(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
      输出验证码
      参数:
      request - HttpServletRequest
      response - HttpServletResponse
      抛出:
      IOException - IO异常
    • out

      public static void out(int len, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
      输出验证码
      参数:
      len - 长度
      request - HttpServletRequest
      response - 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 - HttpServletRequest
      response - HttpServletResponse
      抛出:
      IOException - IO异常
    • out

      public static void out(Font font, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
      输出验证码
      参数:
      font - 字体
      request - HttpServletRequest
      response - 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 - HttpServletRequest
      response - 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 - HttpServletRequest
      response - 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 - HttpServletRequest
      response - HttpServletResponse
      抛出:
      IOException - IO异常
    • out

      public static void out(Captcha captcha, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
      输出验证码
      参数:
      captcha - Captcha
      request - HttpServletRequest
      response - HttpServletResponse
      抛出:
      IOException - IO异常
    • ver

      public static boolean ver(String code, javax.servlet.http.HttpServletRequest request)
      验证验证码
      参数:
      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