valid=false;
}else if(username.matches("/^[a-z|A-Z|0-9]+$/")){
request.setAttribute("usernameError", "账号只能是字母或者数字");
valid=false;
}
if(StringUtils.isEmpty(password)){
request.setAttribute("passwordError", "密码不能为空");
valid=false;
}else if(password.length()>20){
request.setAttribute("passwordError", "密码长度不能大于20位");
valid=false;
}else if(password.length()<6){
request.setAttribute("passwordError", "密码长度不能小于6位");
valid=false;
}
if(!password.equals(password2)){
request.setAttribute("password2Error", "两次输入密码不一致");
valid=false;
}
if(StringUtils.isEmpty(email)){
request.setAttribute("emailError", "电子邮件不能为空");
valid=false;
}else if(!email.matches("^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+.([a-zA-Z0-9_-])+$")){
request.setAttribute("emailError", "电子邮件不正确");
valid=false;
}
if(mobile.length()>11){
request.setAttribute("mobileError", "手机长度不能大于11位");
valid=false;
}
if(qq.length()>20){
request.setAttribute("qqError", "QQ长度不能大于20位");
valid=false;
}
User user = new User();
user.setUserId(UUIDGenerator.getUUID());
user.setUserName(username);
user.setPassword(password);
user.setCreateDate(DateUtil.getCurDate());
user.setEmail(email);
user.setMobile(mobile);
user.setQq(qq); jsp+mysql大学校园二手交易平台开发+数据流图+ER图(9):http://www.youerw.com/jisuanji/lunwen_2112.html