Changeset f9cc555 for src/main/java/com/example/moviezone/web
- Timestamp:
- 02/06/23 17:05:56 (22 months ago)
- Branches:
- master
- Children:
- a69d48c
- Parents:
- 43a1688
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/moviezone/web/HomeController.java
r43a1688 rf9cc555 4 4 import com.example.moviezone.model.Customer; 5 5 import com.example.moviezone.model.Film; 6 import com.example.moviezone.model.Role; 6 7 import com.example.moviezone.model.User; 8 import com.example.moviezone.model.exceptions.PasswordsDoNotMatchException; 7 9 import com.example.moviezone.model.exceptions.UserNotFoundException; 8 10 import com.example.moviezone.service.*; … … 93 95 } 94 96 95 @PostMapping("register") 96 public String register(@RequestParam String username, @RequestParam String first_name, @RequestParam String last_name, 97 @RequestParam String password, @RequestParam String repeatedPassword, 98 @RequestParam String email, @RequestParam String number, 99 @RequestParam String role) 100 { 101 User user = null; 102 user=userService.register(first_name,last_name,username,email,number,password,repeatedPassword,role); 97 @PostMapping() 98 public String register(@RequestParam String username, 99 @RequestParam String first_name, 100 @RequestParam String last_name, 101 @RequestParam String password, 102 @RequestParam String repeatedPassword, 103 @RequestParam String email, 104 @RequestParam String number, 105 @RequestParam Role role) 106 { 107 try { 108 User user=userService.register(first_name,last_name,username,email,number,password,repeatedPassword,role); 103 109 return "redirect:/login"; 110 }catch (PasswordsDoNotMatchException exception) 111 { 112 return "redirect:/register?error=" + exception.getMessage(); 113 } 114 104 115 } 105 116
Note:
See TracChangeset
for help on using the changeset viewer.