|| null == username || null == department || null == birthday
|| null == entryDate) {
return "user/register";
}
// 检查邮箱是否重复的功能
User u = m_UserService.getUserByEmail(email);
if (null != u) {
request.setAttribute("errorMsg", "邮箱已经被注册");
request.setAttribute("password", password);
request.setAttribute("repassword", repassword);
request.setAttribute("username", username);
request.setAttribute("department", department);
request.setAttribute("birthday", birthday);
request.setAttribute("entryDate", entryDate);
return "user/register";
}
Date dBirthday = WebUtils.strFormatDate(birthday);
Date dEntryDate = WebUtils.strFormatDate(entryDate);
User user = m_UserService.registerUser(username.trim(), Misc
.md5Hash(password.trim()), department.trim(), email.trim()
.toLowerCase(), dBirthday, dEntryDate);
user.flush();
request.getSession().setAttribute("userLogin", user);
response.sendRedirect("/activity/index.jspx");
return null;
}