Esempio n. 1
0
 public String update() {
   user = userService.listOne((String) session.get("username"));
   user.setUsername(userInfo.getUsername());
   user.setAddress(userInfo.getAddress());
   user.setAnswer(userInfo.getAnswer());
   user.setEmail(userInfo.getEmail());
   user.setIdiograph(userInfo.getIdiograph());
   user.setIsOpen(userInfo.getIsopen());
   user.setPassword(userInfo.getPassword1());
   user.setQq(userInfo.getQq());
   user.setQuestion(userInfo.getQuestion());
   user.setRealname(userInfo.getRealname());
   user.setSex(userInfo.getSex());
   user.setBirthday(userInfo.getBirthday());
   userService.update(user);
   session.put("username", user.getUsername());
   return "update";
 }
Esempio n. 2
0
 public String register() throws Exception {
   user = new User();
   user.setUsername(userInfo.getUsername());
   user.setAddress(userInfo.getAddress());
   user.setAnswer(userInfo.getAnswer());
   user.setEmail(userInfo.getEmail());
   user.setIdiograph(userInfo.getIdiograph());
   user.setIsOpen(userInfo.getIsopen());
   user.setPassword(userInfo.getPassword1());
   user.setQq(userInfo.getQq());
   user.setQuestion(userInfo.getQuestion());
   user.setRealname(userInfo.getRealname());
   user.setSex(userInfo.getSex());
   user.setBirthday(userInfo.getBirthday());
   if (userService.exist(user)) {
     return "registerFail";
   } else {
     userService.add(user);
     return "registerSuccess";
   }
 }