文件名称:使用JSP生成图片格式的验证码
文件大小:14KB
文件格式:JSP
更新时间:2014-05-02 08:56:41
验证码
使用方式: private boolean checkVerifyCode(OperatorLoginForm form, HttpSession session) { // 获得session中的校验码VERIRY_CODE String verifyCode = (String)session.getAttribute("VERIRY_CODE"); OperatorLoginForm operatorLoginForm = (OperatorLoginForm)form; // 获取验证码 String enterVerifyCode = operatorLoginForm.getEnterVerifyCode(); // 如果验证码超时,则返回失败 if (null == verifyCode) { return false; } else { // 如果验证码输入不正确,则返回失败 if (!verifyCode.equalsIgnoreCase(enterVerifyCode)) { return false; } } return true; }