diff --git a/session8/project-template/shopping-cart-application/web/src/main/java/org/solent/com504/oodd/cart/spring/web/UserAndLoginController.java b/session8/project-template/shopping-cart-application/web/src/main/java/org/solent/com504/oodd/cart/spring/web/UserAndLoginController.java index 4668de822..3b288d333 100644 --- a/session8/project-template/shopping-cart-application/web/src/main/java/org/solent/com504/oodd/cart/spring/web/UserAndLoginController.java +++ b/session8/project-template/shopping-cart-application/web/src/main/java/org/solent/com504/oodd/cart/spring/web/UserAndLoginController.java @@ -220,6 +220,7 @@ public String users(Model model, List userList = userRepository.findAll(); + model.addAttribute("user", sessionUser); model.addAttribute("userListSize", userList.size()); model.addAttribute("userList", userList); model.addAttribute("selectedPage", "users"); @@ -259,8 +260,9 @@ public String modifyuser( return ("home"); } } - User user = userList.get(0); - model.addAttribute("user", user); + User modifyUser = userList.get(0); + model.addAttribute("user", sessionUser); + model.addAttribute("modifyUser", modifyUser); model.addAttribute("message", message); model.addAttribute("errorMessage", errorMessage); return "viewModifyUser"; diff --git a/session8/project-template/shopping-cart-application/web/src/main/webapp/WEB-INF/view/viewModifyUser.jsp b/session8/project-template/shopping-cart-application/web/src/main/webapp/WEB-INF/view/viewModifyUser.jsp index 4ad0b5878..a5483d4a0 100644 --- a/session8/project-template/shopping-cart-application/web/src/main/webapp/WEB-INF/view/viewModifyUser.jsp +++ b/session8/project-template/shopping-cart-application/web/src/main/webapp/WEB-INF/view/viewModifyUser.jsp @@ -27,55 +27,55 @@ User ID - ${user.id} + ${modifyUser.id} username - ${user.username} + ${modifyUser.username} First Name - + Second Name - + House Number - + Address Line 1 - + Address Line 2 - + city - + county - + country - + postcode - + telephone - + mobile - + @@ -90,11 +90,11 @@ Role - ${user.userRole} + ${modifyUser.userRole} enabled - ENABLEDDISABLED + ENABLEDDISABLED @@ -111,7 +111,7 @@ @@ -120,8 +120,8 @@ enabled @@ -129,16 +129,16 @@ - - + +

Update Password

- +

Password

Re Enter Password

- +