Esempio n. 1
0
 // 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";
 }
Esempio n. 2
0
  @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";
  }
Esempio n. 3
0
 public String userCheckout(HttpServletRequest request) {
   String userName = request.getParameter("userName");
   List<UserEntity> userList = userServiceImpl.findUsersByUserName(userName);
   if (userList == null || userList.isEmpty()) return "true";
   return "false";
 }
Esempio n. 4
0
 @RequestMapping("/user/{id}")
 public String detail(@PathVariable(value = "id") String id, ModelMap model) {
   model.put("user", userServiceImpl.getUserEntityById(id));
   return "detail";
 }
Esempio n. 5
0
 @RequestMapping("/userList")
 public String list(ModelMap model) {
   model.put("users", userServiceImpl.getUserEntities());
   return "list";
 }