此篇主要介绍的是接受前台ajax的数据,判断输入的验证码是否正确:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
//从session里面获取图片验证码
String inputCode = request.getParameter("inputCode");
String numrand = (String)request.getSession().getAttribute("numrand");
if(numrand.equals(inputCode)){
out.print("true");
}else{
out.print("false");
}
%>