验证码控件的值与文本框的值的比较问题

来源:百度知道 编辑:UC知道 时间:2024/05/15 19:19:52
我想把验证码控件的值与文本框的值做一个比较,如果不一样,就不能登录。请高手赐教

验证码:<html:text property="checkcode"/>

处理代码是
String checkcode=userloginForm.getCheckcode();
String code=(String)request.getSession().getAttribute("checkCode");

if(checkcode!=null&&checkcode.trim().length()>0&&checkcode.equalsIgnoreCase(code))
然后做判断即可