// 将生产的验证码保存到Session中的validate属性中
HttpSession session = req.getSession();
session.setAttribute("validate", randomCode.toString());//注意,这个验证码是大写字母组成
HttpSession httpSession =ServletActionContext.getRequest().getSession();
session.setAttribute("validate", randomCode.toString());//注意,这个验证码是大写字母组成
String vcode2= (String) httpSession.getAttribute("validate");//取得验证码类存在session中的验证码
if(p.getAsString("yzm").trim().equalsIgnoreCase(vcode2)){//先判断验证码是否输入正确