示例#1
0
 @RequestMapping(value = "/signup", method = RequestMethod.POST)
 public String signup(@ModelAttribute("user") User user, Model model) {
   user.setUserId(CommonUtils.getGUID());
   user.setNickName(user.getNickName());
   user.setCreateDate(DateUtils.getCurrentDateDate());
   userService.save(user);
   model.addAttribute("title", "用户注册");
   return "redirect:query.html";
 }
示例#2
0
 @RequestMapping(value = "/getInfo3/{userId}")
 public String getInfo3(@PathVariable String userId, Model model) {
   User arguser = new User();
   arguser.setUserId(userId);
   User user = userService.loadByKey(arguser);
   logger.info(userId);
   model.addAttribute("user", user);
   return "userInfofromdb";
 }