@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"; }
@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"; }