File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
src/main/java/com/naturalprogrammer/spring/tutorial/controllers Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 55import org .springframework .ui .Model ;
66import org .springframework .validation .BindingResult ;
77import org .springframework .validation .annotation .Validated ;
8+ import org .springframework .web .bind .annotation .GetMapping ;
9+ import org .springframework .web .bind .annotation .PostMapping ;
810import org .springframework .web .bind .annotation .RequestMapping ;
9- import org .springframework .web .bind .annotation .RequestMethod ;
1011import org .springframework .web .servlet .mvc .support .RedirectAttributes ;
1112
1213import com .naturalprogrammer .spring .tutorial .dto .ForgotPasswordForm ;
@@ -20,14 +21,14 @@ public class ForgotPasswordController {
2021 @ Autowired
2122 private UserService userService ;
2223
23- @ RequestMapping ( method = RequestMethod . GET )
24+ @ GetMapping
2425 public String forgotPassword (Model model ) {
2526
2627 model .addAttribute (new ForgotPasswordForm ());
2728 return "forgot-password" ;
2829 }
2930
30- @ RequestMapping ( method = RequestMethod . POST )
31+ @ PostMapping
3132 public String forgotPassword (
3233 @ Validated ForgotPasswordForm forgotPasswordForm ,
3334 BindingResult result ,
Original file line number Diff line number Diff line change 77import org .springframework .ui .Model ;
88import org .springframework .validation .BindingResult ;
99import org .springframework .validation .annotation .Validated ;
10+ import org .springframework .web .bind .annotation .GetMapping ;
1011import org .springframework .web .bind .annotation .PathVariable ;
12+ import org .springframework .web .bind .annotation .PostMapping ;
1113import org .springframework .web .bind .annotation .RequestMapping ;
12- import org .springframework .web .bind .annotation .RequestMethod ;
1314import org .springframework .web .servlet .mvc .support .RedirectAttributes ;
1415
1516import com .naturalprogrammer .spring .tutorial .dto .ResetPasswordForm ;
@@ -23,14 +24,14 @@ public class ResetPasswordController {
2324 @ Autowired
2425 private UserService userService ;
2526
26- @ RequestMapping ( method = RequestMethod . GET )
27+ @ GetMapping
2728 public String forgotPassword (Model model ) {
2829
2930 model .addAttribute (new ResetPasswordForm ());
3031 return "reset-password" ;
3132 }
3233
33- @ RequestMapping ( method = RequestMethod . POST )
34+ @ PostMapping
3435 public String resetPassword (
3536 @ PathVariable String resetPasswordCode ,
3637 @ Validated ResetPasswordForm resetPasswordForm ,
You can’t perform that action at this time.
0 commit comments