// http://localhost:8085/user_cms/userController/showUser.do?id=1 @RequestMapping("showUser") public String showUserEntity(String id, ModelMap modelMap, HttpServletRequest request) { UserEntity u = userServiceImpl.getUserEntityById(id); if (u == null) { u = new UserEntity(); u.setEmail(""); u.setUserId(""); } modelMap.put("user", u); return "showUser"; }
@RequestMapping("/login") public String userLogin(HttpServletRequest request, ModelMap model) { String userName = request.getParameter("user_name"); String password = request.getParameter("password"); UserEntity user = new UserEntity(); user.setUserName(userName); user.setPassword(password); user = userServiceImpl.getUserByNameAndPassword(user); model.put("user", user); if (user != null) { return "index"; } return "page-login"; }